Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

wfzen

@wfzen
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • variable undefined
    W wfzen

    Thank you for your help. I forgot to copy the } after the alert(videoName). So myFunction ends after alert. var playerURL... is not part of the function. I'm trying to take the script out of the function. I'll post back the result.

    JavaScript question tools xml

  • variable undefined
    W wfzen

    I want to extract a video name from XML and put it in the URL parameter. I copied the XML reading code from w3school. See below:

    //var videoName; the name of the video
    var tPath = ... the URL to the XML
    var var2 = ... the filename of an XML
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
    myFunction(this);
    }
    };
    xmlhttp.open("GET", tPath, true);
    xmlhttp.send();
    function myFunction(xml) {
    var x, xmlDoc, videoName;
    xmlDoc = xml.responseXML;
    x = xmlDoc.getElementsByTagName("videoName")[0];
    videoName = (x.textContent);
    alert (videoName);
    }
    var playerURL = "http://" + getCookie("MediaServerGeneral") + "/IVP/demo.htm?XMLName=" + var2 + "&MediaFileName=" + videoName;

    I see the name of the video in alert. but the playerURL has videoName shown as undefined. my XML is like this, and I'm trying to pick up "videoName.mp4":

    videoName.mp4
    

    What is wrong with the script? Thanks,

    JavaScript question tools xml

  • Add a dynamic label to video selected
    W wfzen

    Thanks for the help. I still can't get it to work. Chrome Javascript console says Uncaught TypeError: Object #<HTMLDocument> has no method 'writeIn' Can you give hint on the approach you prefer? I'm a newbie on Javascript. Thanks,

    JavaScript help question

  • Add a dynamic label to video selected
    W wfzen

    I have the following to play a video dynamically by specify the media name and its path. There are multiple links on the same page. A user can click on each link to play a video.

    video 1

    I'd also like to add a label somewhere on the screen so the user knows which video he is playing. I tried the following, by calling getTitle with a number to output the title of the video. The problem is it replace the whole screen instead of placing it somewhere on the screen. So how can I achieve what i need? Thanks for your help,

    function getTitle(tTitle)
    {
    myTitle = ""
    if (tTitle == 1) {
    myTitle = "video 1"
    } else if (tTitle == 2) {
    myTitle = "video 2"
    } else if (tTitle == 3) {
    myTitle = "Video 3"
    } else if (tTitle == 4) {
    myTitle = "Video 4"
    }

    document.write("
    ");
    document.write("Now Playing: " + myTitle);

    }

    JavaScript help question

  • include javascript within document write
    W wfzen

    I use Dreamweaver to generate the rollover Javascript code to something like this:

    The problem is the last part of the link is dynamic. so I tried to include the javascript for rollover and rollout within document.write.

    document.write("[");](http://astringforURL=" + theCourseCode + ")

    [IT does the link OK not the rollover anymore with this. I think it may relate to the single quotes it had initially and I had to change the double quotes into single quotes while retaining the single quote. I can't put the script to do rollover outside either. How can I make it work? Thanks,](http://astringforURL=" + theCourseCode + ")

    JavaScript question javascript tools help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups