SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert javascript for IE to NS and Safari

    Hi,
    Anyone have any tips on a good site with a few pointers on how to convert javascript working on IE to work with NS and Safari. For example, this code doesn't work on Safari but on IE and I have no idea why:

    <div id="divFold0" class="expMenuMain"><a href="/html/omplastik/omplastik.shtml" class="expLinxMain" onclick="visaMain(0);hideshow('omplastik'); if(B.ie5 || B.ie4) this.blur(); return false"><img src="/images/menu/main/plastikkirurgi1.gif" name="expPlastikkirurgi" border="0"></a><br>
    <div id="divFoldSub0_0" class="expMenuSub"><a href="/html/omplastik/historia.shtml" target="main" class="expLinxSub" onclick="hideshow('historia');"><img src="/images/menu/sub/historia.gif" border="0"></a><br>
    <div id="divFoldSub0_0_0" class="expMenuSub2">x</div>
    </div>
    <div id="divFoldSub0_1" class="expMenuSub"><a href="/html/omplastik/defenitioner.shtml" target="main" class="expLinxSub" onclick="hideshow('def');"><img src="/images/menu/sub/Definitioner.gif" border="0"></a><br>
    <div id="divFoldSub0_1_0" class="expMenuSub2">x</div>
    </div>
    <div id="divFoldSub0_2" class="expMenuSub"><a href="/html/omplastik/skonhetideal.shtml" target="main" class="expLinxSub" onclick="hideshow('skonhet');"><img src="/images/menu/sub/skonhetsideal.gif" border="0"></a><br>
    <div id="divFoldSub0_2_0" class="expMenuSub2">x</div>
    </div>
    <div id="divFoldSub0_3" class="expMenuSub"><a href="/html/omplastik/asikter.shtml" target="main" class="expLinxSub" onclick="hideshow('asikter');"><img src="/images/menu/sub/asikter.gif" border="0"></a><br>
    <div id="divFoldSub0_3_0" class="expMenuSub2">x</div>
    </div>
    </div>


    Cheers,
    Slippy

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neither do we. Any chance of seeing those functions? What's 'B.ie5' and 'B.ie4'? Probably a sniffer object, but...

    Probably best to learn how to write DOM-compliant JavaScript, period. This will generally run in Internet Explorer, albeit with a few (key) changes, and you won't be developing bad habits. Unless you're tied to specific scripts, why not just use ones that are already cross-browser? 'Conversion' can be more trouble than it's worth.

    http://www.quirksmode.org/dom/contents.html
    ::: certified wild guess :::


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •