External.php js

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mOdEtWo
    Senior Member
    • Dec 2003
    • 334
    • 3.7.x

    External.php js

    Hello.

    I'm trying to implement a javascript on a website that will display threads and thread posters on a website, with the titles and names being links to the threads and profiles. I'm also trying to format it so it looks good.

    I have however little to no experience with javascript.

    I found this post, so now I know how I include the feed in a javascript, and it works as intended.

    Code:
    <script src="/yourvb3location/external.php?type=js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    for (i in threads)
    {
    document.writeln(threads[i].title + " (" + threads[i].poster + ")<br />");
    }
    //-->
    </script>
    However, whenever I try to use HTML codes within the javascript, it breaks and won't display a bit. How can I for an example make the thread titles bold and the thread posters italic?

    It would be cool if anyone have some good examples on formatted external js threads.


    Also, it seems that the external javascript doesn't display updated threads (e.g. threads with new posts), only new threads. Instead of working like "New Posts" search, it only shows the 10 newest threads regardless of what thread that was last posted in. Can this be changed?
    Last edited by mOdEtWo; Thu 7 Apr '05, 6:09am.
    meow
  • tatyana
    New Member
    • Jan 2003
    • 29
    • 3.0.1

    #2
    Check out this hack:

    This is a discussion forum powered by vBulletin. To find out about vBulletin, go to http://www.vbulletin.com/ .


    And as for using html code with js, make sure you use quotes and plus signs:

    document.writeln("<b>" + threads[i].title + "</b>" + " (" + threads[i].poster + ")<br />");

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...