Page 1 of 1

spent all levels of ' " and \"

Posted: Wed Jun 02, 2010 6:01 pm
by janper
hello.
a stupid question - i need to echo this in PHP:

onclick='javascript: document.getElementById("k10").innerHTML ="<iframe src =\"./new.php?subfolder=projects&level=1\" ></iframe>";'

but i already used both ' and " with \" for the javascript, so i don't know how to write the quotes to make sure i'll post exactly this into the page.

thanks!

Re: spent all levels of ' " and \"

Posted: Wed Jun 02, 2010 6:06 pm
by Weirdan

Code: Select all

<?php
//some php code 
?>onclick='javascript:document.getElementById("k10").innerHTML ="<iframe src =\"./new.php?subfolder=projects&level=1\" ></iframe>";'<?php
// some php code

Re: spent all levels of ' " and \"

Posted: Wed Jun 02, 2010 6:10 pm
by janper
i see

will it work when it's inside of a php function? i actually also need to use a variables for ?subfolder=projects&level=1

Re: spent all levels of ' " and \"

Posted: Wed Jun 02, 2010 6:22 pm
by janper
great! it does work!

i really have learned something now ;) thanks