Support » Themes and Templates » Where do I add a javascript link? (trying to create sortable table)

  • Resolved somanyqs

    (@somanyqs)


    Hello everyone [newbie alert!]-
    I’m learning WP by basing my theme on Whitespace

    I have added some javascript for a sortable table to my site (from http://yoast.com/articles/sortable-table/), and then I added a link to a head-section.

    I think I am probably putting the codes in the wrong spots or modifying incorrectly – I am trying to figure out where to put the head-section. If it belongs in home.php, page.php or somewhere else.
    For now I tried adding it to page.php (Page Template) by just typing

    <head>
    <script src="sortable_us.js" type="text/javascript"></script>
    </head>

    but still am not having any luck.
    The page I am trying to get working is
    http://criticalgolf.com/?page_id=83

    Any advice would be great. Thanks!
    J

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter somanyqs

    (@somanyqs)

    I read via
    http://codex.wordpress.org/Using_Javascript#Troubleshooting_Javascript

    that I need to have the script in between the meta tags and style link within header.php, so I have moved
    ‘<script src=”http://criticalgolf.com/wp-admins/js/sortable_us.js&#8221; type=”text/javascript”></script>’
    to that spot in header.php.

    I think I’m getting closer…still no luck, however…

    Why is this marked resolved? Read the last line of the second post !!

    Just to reinforce that statement – I am having the same issues in WP2.8.4 and searching the forums finds hundreds of other threads with the same problem.

    C’mon WP Devs – you can’t fix this problem by just marking topics as resolved when they are not.

    There is a serious and fundamental problem in WP now with Javascript and it’s been running since at least v2.5 – according to my current project that I have spent 3 days trying to solve (without success), FireBug shows the page code has grabbed the data to be output and it’s fully formatted and ready to display, but WordPress just simply refuses to let it show up on screen. It displays fine if I access the script directly in the browser – everything is beautifully laid out (it’s a catalogue table from an oscommerce database) but WordPress says nope, no way, not gonna let you see it.

    So, this topic is not solved as no working solution is posted in it.

    Some help would be appreciated if anyone has this problem licked?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where do I add a javascript link? (trying to create sortable table)’ is closed to new replies.