johnrb87 Posted October 17, 2010 Share Posted October 17, 2010 Hi all I have written a javascript which loads a DIV content area on my html page, it currently looks like function loadit(divname,title) { document.getElementById(divname).innerHTML='<div class="loadit">Help for '+title+' book - <a onClick=closeit("divwindow",'+title+')>ok</a></div>'; } but for some reason it does not like the following part of the code onClick=closeit("divwindow",'+title+') and if I remove it, the script runs fine, but problem is that I need that part of it any reason why it's not allowing that? Nothing I try altering it to seems to work Any help would be great Thanks Quote Link to comment https://forums.phpfreaks.com/topic/216093-javascript-variable-halting-script/ Share on other sites More sharing options...
johnrb87 Posted October 17, 2010 Author Share Posted October 17, 2010 any ideas anyone? It seems like '+title+' is just not being allowd Quote Link to comment https://forums.phpfreaks.com/topic/216093-javascript-variable-halting-script/#findComment-1123094 Share on other sites More sharing options...
johnrb87 Posted October 17, 2010 Author Share Posted October 17, 2010 solved it Quote Link to comment https://forums.phpfreaks.com/topic/216093-javascript-variable-halting-script/#findComment-1123097 Share on other sites More sharing options...
Colton.Wagner Posted October 18, 2010 Share Posted October 18, 2010 Okay, mark it as solved and it had to do with the quotes didn't it? Thanks, Colton Wagner Quote Link to comment https://forums.phpfreaks.com/topic/216093-javascript-variable-halting-script/#findComment-1123162 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.