Search code examples
iframeampersand

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???

Solution

  • & 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.