Jaider
Jaider

Reputation: 14914

iFrame And URL with & (ampersand)

I have a page that contains an iFrame point to a URL with parameters. The URL look like: http://www.myurl.com/page.aspx?parameter1=A&parameter2=B When it is edited in some of these WYSIWYG the & is changed to & and that work fine. but rarely my log told me that my page.aspx doesn't find the second parameter... if I copy and paste the URL with & in the browser http://www.myurl.com/page.aspx?parameter1=A&parameter2=B doesn't work that only work inside of the iFrame...

  1. We already look into the possibility my page contain something like this: &
  2. I already tested in Firefox4, IE9 and Chrome17 and look iFrame render & well.
  3. Could be other browser that doesn't support/render & in the iFrame, if so which ones??? Any other idea that suggestion???

Upvotes: 2

Views: 5342

Answers (2)

Eleanor Zimmermann
Eleanor Zimmermann

Reputation: 432

Also consider using double quotes around the parameter, e.g. instead of:

src = 'http://blahblah.com'

do

src = "http://blahblah.com"

When I changed that, I didn't need to escape the ampersand anymore

Upvotes: 2

Oscar Broman
Oscar Broman

Reputation: 1127

& is used to escape an ampersand (&) in XML. You should always use & instead of just & in attributes such as href. When pasting it in your browser's address bar, you should't use & simply because it doesn't do any form of XML parsing.

Upvotes: 2

Related Questions