Java script problems on wordpress page

Discussion in 'WordPress' started by ~kev~, Jul 25, 2008.

  1. #1
    VBulletin has this feature called "External Data Provider" which has been enabled on my forum and working fine for at least 6 months. So I know that is not the problem. A java script queries the data provider, and the data provider gives the script the data to post on a webpage.

    I want to make a page on 2 wordpress sites, use this script on them and pull the latest post from my forum. Simple enough.

    When I make the wordpress page with the code shown below in it, the latest post do not show up. The HTML tab in the wordpress text editor is selected when the code is pasted.

    Here is the page on my site where the code is at http://www.survivalforum.us/forum/

    I made a a simple HTML page to test the code and it works fine there. But when the code is copied from the HTML page and pasted into a wordpress page, it stops working. The code works fine on a basic HTML test page, but does not work on a wordpress page, why? What can be done to fix this?

    And here is the actual code. All it does is query the external data provider on my VB forum. The feed is working, as seen here - http://www.survivalistboards.com/external.php

    The feed works, the java script works on an HTML page, what does the wordpress page do that stops the script from working and how do I fix it?

    <!-- show latest active threads -->
    <table border="0">
    <tbody>
    <tr>
    <td><strong>Latest Active Threads on The Forum</strong></td>
    </tr>
    </tbody>
    <tbody>
    <tr>
    <td width="100%">
    <div><script src="http://www.survivalistboards.com/external.php?forumids=49,71,108,11,78,103&amp;type=js" type="text/javascript"></script> <script type="text/javascript"><!--
    for (x = 0; x < 15; x++)
    {
    document.writeln("<a href="\" mce_href="\""http://www.survivalistboards.com/showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a>
    (Posted By: "+threads[x].poster+")
    
    ");
    }
    // --></script></div></td>
    </tr>
    </tbody></table><ins datetime="2008-07-25T13:52:55+00:00"></ins>
    Code (markup):
    As stated before, the code works on a simple HTML page, but not a wordpress page. This code is straight from www.vbulletin.com, except for the forum IDs, I added those.
     
    ~kev~, Jul 25, 2008 IP
  2. Anghus

    Anghus Peon

    Messages:
    510
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi there, download Script Enabler for Wordpress. Install under the plugins. Create a new page, and just copy paste the script code.
     
    Anghus, Jul 25, 2008 IP
    ~kev~ likes this.
  3. ~kev~

    ~kev~ Well-Known Member

    Messages:
    2,866
    Likes Received:
    194
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thank you!

    That fixed the problem.
     
    ~kev~, Jul 25, 2008 IP
  4. PDFoxy

    PDFoxy Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The script is work! Thanks
     
    PDFoxy, Oct 2, 2008 IP