WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this code which runs perfectly on jsFiddle. When I try to run that code on my self-hosted WordPress site, however, it will not run. (The code is exactly the same on my page, except that I added <script type="text/javascript" src="/files/jquery-1.8.3.min.js"></script> before the Javascript on the page.) The Javascript is directly in the Text tab of my page, JS first followed by the HTML. The form loads properly, but clicking the "Add Row" button does nothing.

I had this issue on another page on my site, but it was fixed by wrapping everything in

    // code

and using jQuery noConflict mode. I implemented that here (as you can see in the code), but it is not working.

share|improve this question
up vote 0 down vote accepted

As for me, in WP I always use jQuery instead noConflict mode, Try to run this code: http://jsfiddle.net/GKmvA/1/

share|improve this answer
I just tried that and it unfortunately did not work. – Vaindil Dec 20 '12 at 2:54
could you post here what FireBug (or Chrome Inspector) said? Do you see eny error? Put <code>alert('It works');</code> before JS-code. Do you see alert after page refresh? – Maxim Orlovsky Dec 20 '12 at 2:56
Sorry, I should've done that. I'll edit my original post, but it says Uncaught SyntaxError: Unexpected token < on line 175. Line 175 is var rows = 1;, but WordPress autoformats it to display a </p> after the line (so var rows = 1;</p>). After removing all of the whitespace and linking it as a .js file (instead of directly embedding), it now works. Thank you! – Vaindil Dec 20 '12 at 3:04
You are welcome – Maxim Orlovsky Dec 20 '12 at 3:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.