this is my function to update src value
function browse(id,url){
alert(url);
document.getElementById("main").value = url ;
}
this is how i call it:
<li style="min-width:350px;" title="click to play me"><a href="#" onclick="browse(68118,http://push2check.com/)" >' . $this->titulo . '</a><li>
this is firebug error (of corse the alert is never executed): missing ) after argument list
[Interrumpir en este error] browse(68118,http://push2check.com/);
What i dunt understand is the error, is the onclick ok?
It’s because of this:
That URL needs to be quoted:
The value you give an “onclick” attribute has to be a valid HTML attribute value that contains valid JavaScript. If you wrote:
you would probably not expect that to work; the URL syntax doesn’t mean anything directly to JavaScript, so it would be a syntax error.