Link to home
Start Free TrialLog in
Avatar of error77
error77

asked on

Syntax issue with javascript and quotes

Hi all,

I am having some issues with code synta not working...

For example:

This code works fine:

<li>
<a href="#" onclick="window.plugins.childBrowser.showWebPage('http://www.mysite.com');">
<img src="images/thumb.jpg" />
<h3>Text Here</h3>
<p>text</p>
</a>
</li>

Open in new window


But this code (added via javascript does not):

output += '<li><a href="#" onclick="window.plugins.childBrowser.showWebPage('http://mysite.com');"><img src="'+value.thumbnail_url+'" /><h3>'+value.title+'</h3>'+value.body+'</a></li>';

Open in new window


I think the problem is here:

onclick="window.plugins.childBrowser.showWebPage('http://mysite.com');" ....

to be more precise here:

('http://mysite.com');

but I've tried:

("'http://mysite.com'") and (&quote;'http://mysite.com'"e;) but it still doesn't work.

Anyone got any ideas please?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial