Announcement

Collapse
No announcement yet.

External.php js

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 7th Apr '05, 6:09am.
    meow

  • #2
    Check out this hack:

    http://www.vbulletin.org/forum/showt...t=external.php

    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...
    X