Mobile app version of vmapp.org
Login or Join
LarsenBagley505

: Double vs Single Quotes in Chrome So when you want to embed google docs on a site you are given this chunk of code: <iframe width='500' height='300' frameborder='0' src='https://docs.google.com/spreadsheet/pub?hl=en_US&hl

@LarsenBagley505

Posted in: #GoogleChrome #Html #Iframe

So when you want to embed google docs on a site you are given this chunk of code:

<iframe width='500' height='300' frameborder='0' src='https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AiV6Vq32hBZIdHZRN3EwWERLZHVUT25ST01LTGxubWc&output=html&widget=true'></iframe>


This works fine on my site. If you edit the page, we run the new content through some filters to escape out stuff and make sure it is valid html. After the process, the link above gets converted to this:

<iframe frameborder="0" height="300" src="https://docs.google.com/spreadsheet/pub?hl=en_US&amp;hl=en_US&amp;key=0AiV6Vq32hBZIdHZRN3EwWERLZHVUT25ST01LTGxubWc&amp;output=html&amp;widget=true" width="500"></iframe>


This will work on every browser except for chrome. Chrome thinks I am running JS in the src. I narrowed it down to a combination of double quotes and escaped '&' symbols. If i revert one of those back to the original state, the iframe works.

I work in ruby where ' and " have different behaviors. Is Chrome doing the same thing? Is there a way to turn that off?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @LarsenBagley505

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

Double, use it everywhere, thats the HTML Standard.

However, both work on almost every browser. Some browsers you can even use nothing, like width=1

10% popularity Vote Up Vote Down


 

@Phylliss660

I think you should modify your filters to accept the & sign in a src url.

The main problem for me is your filter part, i can't imagine the huge list of problems you may run into if you filter out valid urls.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme