How can I associate the right and left columns in the background? Can I use PHP to read and write data or JavaScript? -Php Tutorial

Source: Internet
Author: User
How can I associate the right and left columns in the background? Can I use PHP to read and write data or JavaScript? I am not talking about the old frame mode;

The website background is divided into the left and right columns;

When you click the list in the left column, how does one display the content in the content area in the right column? Is it refreshing the entire page? Or read the content of the corresponding file through JSON, and then write JS to the content area on the right bar;

Ask the old bird how to get the website background details. especially, after a user clicks, how can he ensure that the clicks on the left column remain unchanged on the next page? is this right column template used every time, this is unrealistic?


PHP is very skillful, but it is not written in a large project. I would like to ask for advice on HTML writing in the background;


Reply to discussion (solution)

When you click the list in the left column, how does one display the content in the content area in the right column? Is it refreshing the entire page? Or read the content of the corresponding file through JSON, and then write JS to the content area on the right bar;


You can use either of these methods.
Should you be fine with ajax?
What is the problem with refreshing the entire page? Which of the following points does you know? if you change the class corresponding to the lower left column, the style does not change?

I don't want to use iframe. I can only use ajax to refresh it asynchronously. it is a little troublesome to develop. I suggest using iframe.
Either the complete page jumps over and the current column is located on the left.

Use jquery

  $('#left a').click(function(){    $('#right').load(this.href)    return false;  });
Solved the problem.

Upstairs

Use jq,
Http://www.w3school.com.cn/jquery/ajax_load.asp

Jquery asynchronous loading

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.