OnClick function

Discussion in 'Web Development & Web Hosting' started by twizzle, Mar 16, 2010.

  1. twizzle

    twizzle Gigabyte Poster

    1,842
    43
    104
    Ok having abbandoned the attempt at CSS adn usingteh Z-index, i designed my page in html and tables (yeah so 90's! :tongue )
    Now i'm trying to use a javascript line to make my buttons reference an iframe.

    heres the script
    function ButtonClick(name)
    {
    wb.src="http://mobileruntime.co.uk/wb/whiteboardshow.pl/mobileruntime/wbfile"+name;
    }

    And heres an example of the corresponding html

    <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','images/supporton.png',1)" onClick="ButtonClick('Support%20index.wb')"><img src="images/support.png" name="Image9" border="0"></a>

    Thing is when uploaded this seems to do nothing, the button doesnt open a new page in the iframe i'm using. can anyone see where i'm going wrong?
     
    Certifications: Comptia A+, N+, MS 70-271, 70-272
    WIP: Being a BILB,
  2. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    172
    211
    if you put an alert("function fired"); at the start of the function, is it firing?
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  3. twizzle

    twizzle Gigabyte Poster

    1,842
    43
    104
    yep seems to firing ( i put the alert after the function so it happens when i click the button.) Just doesnt seem to load my page right. Checked the address etc and thats all fine.
     
    Certifications: Comptia A+, N+, MS 70-271, 70-272
    WIP: Being a BILB,
  4. twizzle

    twizzle Gigabyte Poster

    1,842
    43
    104
    fixed it, the functions should have documnet.getElementById.src instead of just wb.src and then give teh iframe and id="".

    Thanks for looking Fergs. javascript will kill me.....
     
    Certifications: Comptia A+, N+, MS 70-271, 70-272
    WIP: Being a BILB,

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.