WordPress.org

Ready to get started?Download WordPress

Forums

Javascript in text widget (1 post)

  1. bwareham
    Member
    Posted 7 years ago #

    I've got a problem with a javascript-based text widget on my site. It's designed to show information from the last song I listened to on iTunes - album image/artist/song/album title.

    It works fine in Firefox, my personal browser of choice, but comes up empty in Safari or IE.

    In the text widget I've inserted this:
    <script type="text/javascript" src="http://bilware.net/music/now_playing.php"></script>

    The src url generates something that looks like this:

    document.write('
    \"The
    The Brian Setzer Orchestra
    Jingle Bells
    From the album Boogie Woogie Christmas
    ');

    In an effort to isolate the problem I've stripped down the php doc that generates the document.write function to take out all the URls and anything else that may be screwing things up, but even at just the unadorned album title it still won't show beyond Firefox.

    I only know enough about javascript to cobble together this kind of simple code from stuff others have written, so there's probably something obvious I'm missing.

    I'd appreciate any help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags