• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Odd jscript problem"

Collapse

  • Bunk
    replied
    Originally posted by xoggoth View Post
    Cheers. Got firebug and IE has summit similar now. Ought to get round to using em instead of sticking alert stas in. Nostalgia for ZX81 days probably.
    Yeah, nothing wrong with a few alerts but the debugger is much more comprehensive. Lets you step through and check what the variables and objects contain at each step. Check out the script and console tabs in Firebug, that's where the useful stuff is.

    Leave a comment:


  • xoggoth
    replied
    Cheers. Got firebug and IE has summit similar now. Ought to get round to using em instead of sticking alert stas in. Nostalgia for ZX81 days probably.

    Leave a comment:


  • Bunk
    replied
    I would recommend installing Firebug if you haven't already. You can use the Javascript debugger to stick some breakpoints into the code and see what's happening.

    Leave a comment:


  • xoggoth
    replied
    You're right! It's the call that is failing not the test.

    Still no idea why the call fails when there is no jscript error and a dummy function with the same arguments is ok. Have to comment the lines out and see why.

    Thanks very much k2p2.

    Leave a comment:


  • mudskipper
    replied
    Are you sure it's the comparison that's failing? Have you tried

    if (state==1) alert("true");

    Leave a comment:


  • xoggoth
    started a topic Odd jscript problem

    Odd jscript problem

    Only a bloggy thing at moment so not important but annoying!! Using Google Youtube api to kick off another function when someone starts a youtube video. The change state handlers below work fine, and the function gets called if you start either video. But it then won't call the function for the other video even though the handler is called and state is correct.

    To be a bit clearer say I start video 1 first. The alert in changeplay1 reports state to be 1 and the lyrics function is called. If I start video 1 second the alert in changeplay1 still reports state to be 1 and yet the function does not get called. If state is 1 how can if (state==1) suddenly not work? Wierd.

    function changeplay2(state)
    {
    alert("Player 2 new state:X" + state + "X");
    if (state==1) showlyrics('showlyrics2','lyriclines2','lyrictimes 2');
    }
    function changeplay1(state)
    {
    alert("Player 1 new state:X" + state + "X");
    if (state==1) showlyrics('showlyrics1','lyriclines1','lyrictimes 1');
    }
    function showlyrics(showline,llist,tlist)
    {
    alert("LYRICS ",showline);
    etc


    Have tried "1", 1*state etc in case state is a string or has appended spaces etc. There are no jscript errors. Any other bright ideas?

    Cheers.
Working...
X