WordPress.org

Ready to get started?Download WordPress

Forums

How to use .js file in PHP? (4 posts)

  1. elyn
    Member
    Posted 8 years ago #

    How to use .js file in PHP? I've tried to use "<script language="JavaScript" src="abc.js"></script>" between <head> and </head>, but it doesn't work. Could anybody lend me a hand?

  2. nearlythere
    Member
    Posted 8 years ago #

    instead of language, try 'type', like this:

    <script src="/path/name.js" type="text/javascript"></script>

  3. elyn
    Member
    Posted 8 years ago #

    Thanks. But...nothing happened...:(

  4. Michael Bishop

    Posted 8 years ago #

    for src are you using the full path? And I generally call the type before the src, opposite of the example given.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags