Quotation mark problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

bobo
New php-forum User
New php-forum User
Posts: 12
Joined: Mon Jul 21, 2003 1:09 am

Quotation mark problem

Postby bobo » Mon Sep 01, 2003 12:29 am

I have problem about the quotation marks!!! it really annoys me!!

<a href="#" onClick="javascript:popup_window('javascript:document.write(&quot;<a href=" sp13.bmp"><img src=sp13.bmp></a&quot;);',500,400);return false;">

The Green color quot should be a pair but.... the Red color one cut i off!!! so It is read as wrong language!!!

but if I remove the quot as <a href=sp13.bmp> and it won't works...

is it possible to use other punctuation to replace it????

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

quotes

Postby ruturajv » Mon Sep 01, 2003 1:02 am

The quotes in Javascript are to be used alternatively to make Javascript understand that they are quotation marks

Code: Select all

onClick = "document.write('This is in single quotation marks')";


Please put your code in the code tag of the forum to help understand better

sigix
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Postby sigix » Mon Sep 01, 2003 6:17 am

are you using any web development tool to this javascript to embed in html :?:

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Re: Quotation mark problem

Postby swirlee » Mon Sep 01, 2003 9:21 am

Just like in PHP, you can escape quotation marks in JavaScript using \.

Also, when using JavaScript in an OnClick event, you don't need to include the "javascript:" declaration. You only need that if you're putting that in the href="" of a link.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest