html - how to add popup window hyperlink into javascript variable? -


i trying place popup window hyper link inside javascript variable when outputh result div hyperlink doesn't(when clicking on it) open , got wrong url! 1 show me how fix problem.thanks

  var sitecontents2 = "<li>" +"<a href='javascript:window.open('http://awebsite.com/static/flash/ok1234567890123445.swf?itemid="+itemname+", 'yourwindowname', 'width=200,height=150')'>"+itemname+"</a>"; 

the hyperlink produced inside div doesn't open , got wrong url!:

   <a href="javascript:window.open(" 'http:="" awebsite.com="" static="" flash="" ok1234567890123445.swf?itemid="pen" ,="" 'yourwindowname',="" 'width="200,height=150')'">pen</a>  document.getelementbyid("mydiv").innerhtml += sitecontents2; 

you quote terminations not proper

var sitecontents2 = "<li>" +"<a href=\"javascript:window.open('http://awebsite.com/static/flash/ok1234567890123445.swf?itemid="+itemname+"', 'yourwindowname', 'width=200,height=150')\">"+itemname+"</a>"; 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -