I've been getting more and more frustated with what seems to be a fairly simple problem:
I've got a javascript function that changes the innerHTML of a <div> tag. I need the content that is replaced to be a link that has an onClick function inside. This is where it gets a bit more complicated, I'm using PHP to generate this string so an added level of escaping quotes on so on needs to be considered.
MY PHP looks like this:
$string .= " onChange=\"MM_changeProp('locfinder','','innerHTML', 'LINK','DIV')\"";
I want LINK to show
<a href="javascript:;" onClick="MM_openBrWindow('location_finder.php?loc_province=' + this.value,'locfinder','scrollbars=yes,width=400,height=400')">link</a>
I can use both functions individually and they work fine.
I think I'm just getting a bit mixed up with escaping characters. Any help would be greatly appreciated!
I've got a javascript function that changes the innerHTML of a <div> tag. I need the content that is replaced to be a link that has an onClick function inside. This is where it gets a bit more complicated, I'm using PHP to generate this string so an added level of escaping quotes on so on needs to be considered.
MY PHP looks like this:
$string .= " onChange=\"MM_changeProp('locfinder','','innerHTML', 'LINK','DIV')\"";
I want LINK to show
<a href="javascript:;" onClick="MM_openBrWindow('location_finder.php?loc_province=' + this.value,'locfinder','scrollbars=yes,width=400,height=400')">link</a>
I can use both functions individually and they work fine.
I think I'm just getting a bit mixed up with escaping characters. Any help would be greatly appreciated!