-1

I am using AJAX to call a html file and the file uses jquery and javascript which I have already called in the page before .But the javascript (and CSS) are not being executed. How can we get my javascript to work.

0

2 Answers 2

0

With the limited information you provided the only solution I can think of is to use jQuery's $.get() more about it here

$.get("yourjsfile.js");//It will request your file and execute it $.get("yourcssfile.css");//Similarly for your CSS file.

Sign up to request clarification or add additional context in comments.

Comments

0

Write them in the <body/> instead of <head/>. The codes out of <body/> will be drop after jQuery("someSelector").load()

And jQuery(document).ready() will not be executed.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.