0

I need to run jquery code in my content type form so i added jquery-1.8.0.min.js file in info file of my theme.

after clear all caches something wrong happened, the "add more" button on date field stop working, i'm sure it's from adding the js file.

Any suggestion?

2
  • I'm not sure I understand the problem. Do you want to add your own inline jQuery code (and not jQuery itself) inside the edit node page?
    – Pere
    Commented Mar 4, 2013 at 22:41
  • yes i want to run my code in node edit form, but it's not working Commented Mar 4, 2013 at 23:14

1 Answer 1

4

Drupal already includes jQuery. You should not add another jQuery library because this can cause conflicts with the existing one.

I suggest you to use jQuery Update if you want to use another version of jQuery.

If what you want is to run your own javascript code, you could add it using drupal_add_js().

Hint: Try first with alert('hello world'). See Working with JavaScript and jQuery.

3
  • my jquery code does not execute inside drupal code Commented Mar 4, 2013 at 22:37
  • i'm so sory drupal core (drupal website) Commented Mar 4, 2013 at 23:13
  • Ok, see updated answer. And please read the documentation :)
    – Pere
    Commented Mar 4, 2013 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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