Jump to content

one line


westman

Recommended Posts

i have an error in one line of javascript code...

  $("#whatisit").html('<a href="#" title="chat" onclick="return false" onmousedown="javascript:togglechat('"+chat+"');"><img src="chat.png" alt="chat" width="44" height="40" /></a>').show();

the problem is '"+chat+"'what do i put there?

Edited by westman
Link to comment
Share on other sites

You can't use double quotes with an event call that uses double quotes as opening and closing, try

$("#whatisit").html('<a href="#" title="chat" onclick="return false" onmousedown="javascript:togglechat('+chat+');"><img src="chat.png" alt="chat" width="44" height="40" /></a>').show();

Link to comment
Share on other sites

togglechat('+chat+') = i can not see the imagetogglechat(chat) = i can see the image but togglechat will not runtogglechat(\''+chat+'\') = i can not see the imagetogglechat() = i can see the image but togglechat will not run still not working :(

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...