Problem description:
The html code is as follows:
<Iframe src = "http://www.jb51.net" id = "addOrUpdateIframe" style = "width: 870px; height: pixel PX;" border = "0" scrolling = "yes"> </iframe>
I used the attr method of jquery to set the src attribute of iframe.
$ ("# AddOrUpdateIframe"). attr ("src", "http://blog.jb51.net/search.aspx? Key = 400 "); // click the link to view the number of pages (the first page of data is displayed)
No problem. I got the desired result, but the following address drops all the parameters following the key (the parameters in the red font are not obtained)
$ ("# AddOrUpdateIframe"). attr ("src", "http://blog.jb51.net/search.aspx? Key = 400 & page = 2 "); // you can click the link to view the effect. Note the number of pages (the second page is displayed)
Depressed, I felt very strange. I used firebug to look at the modified value. I found the problem. jquery changed the above address:
Http://blog.jb51.net/search.aspx? Key = 400 & page = 2 // click the link to view the effect. Note the number of pages (the first page of data is displayed)
Depressed ................
I haven't found a solution for a long time. How can I change the address &? Not understand
Solution:
Accidentally
$ ("# AddOrUpdateIframe"). attr ("src", "http://blog.jb51.net/search.aspx? Key = 400 & page = 2 "); // you can click the link to view the effect. Note the number of pages (the first page of data is displayed)
Change
$ ("# AddOrUpdateIframe"). attr ("src", 'HTTP: // blog.jb51.net/search.aspx? Key = 400 & page = 2'); // you can click the link to view the effect. Note the number of pages (the second page is displayed)
Pay attention to the gray background and change the double quotation marks to single quotation marks. The problem is solved.