Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Double Quote Issue 1

Status
Not open for further replies.

axman505

Technical User
Jun 20, 2001
489
US
I have the following hunk of code in a document:

Code:
	$report .= "<td><span class='receipt'><a href='receipt.php?interfaceordernum=".$curOrder->id."' onclick=\"window.open(this.href,'_blank');return false;\">".$curOrder->id."</a></span></td>";

This hunk is included in a string which is printed to a javascript window using windowName.document.writeln(\"".$report."); from php.

How can i take care of the double quote's on the on click event above, which is causing problems.

Thanks
 
Have you tried \\\" ?

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
If the following is copied and pasted from your code, you're missing an escaped double quote:

windowName.document.writeln(\"".$report.");


Should be

windowName.document.writeln(\"".$report."[red]\"[/red]);

Lee
 
thanks tsdragon, i was trying \\" instead of \\\"

and trollacious, that was just a typo in the code posted above.
 

Trying to spot a typo in a post which is not the same as the code that errors. Nice ;o)



[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top