niche Posted October 2, 2012 Share Posted October 2, 2012 (edited) this line produces a parse error according to my developer tool. echo 'var div = document.getElementById('subcat');'; I think it's the dot that's the problem. what's the notation for this situation please? Edited October 2, 2012 by niche Link to comment Share on other sites More sharing options...
Don E Posted October 2, 2012 Share Posted October 2, 2012 Looks like you have to escape the the single quotes for subcat: echo 'var div = document.getElementById(\'subcat\');'; 1 Link to comment Share on other sites More sharing options...
niche Posted October 2, 2012 Author Share Posted October 2, 2012 That's it. I must've used the wrong slash. Thanks Don E. Link to comment Share on other sites More sharing options...
birbal Posted October 2, 2012 Share Posted October 2, 2012 best would be echo "var div = document.getElementById('subcat');"; for better readibilty. escaping makes it messy and harder to read. 1 Link to comment Share on other sites More sharing options...
niche Posted October 2, 2012 Author Share Posted October 2, 2012 Don't know how that started. Thanks birbal. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now