/    Sign up×
Community /Pin to ProfileBookmark

Urgent: Please Help!!!!!!!!!

To whom it may concern,
I have the following lines in my JS code:
w.document.write(“<li><input type=’button’ value='” + tabs[i] + “‘ name=’tab” + i + “‘></li>”);
w[‘tab’+i].onclick = tabs_onclick(tabs[i]);

function tabs_onclick(value)
{
return (function tabs()
{
<part of the function that works ok…>
});
}

The code above works fine in IE but doesn’t work in MAC OSX SAFARI. To be exact the return function in the onclick function doesn’t work in Safari. Please let me know what can I do to make it work. Any help is appreciated.
Thx.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorSep 19.2006 — 
  • - write the string otherwise, nested in single quotes and using double quotes for attributes' values:


  • document.write('<li><input type="button"...............>')

  • - if you need single quotes inside the string, escape them:


  • '<input type="button" onclick="somefunction('someparameter') ".....>'

  • - and probably:

    [B]

    return tabs();[/B]


  • instead of weird for me:

    [B]return (function tabs()[/B]
    Copy linkTweet thisAlerts:
    @KorSep 19.2006 — ...and please, do not give your thread such a silly title as "Urgent: Please Help!!!!!!!!!" Everyone needs help, everyone is hurry, no surprise. Use the thread's title to distilate your problem, maybe like: "code works in IE, but not in Safari" or "Returned variable does not work in safari"... or something like that....
    ×

    Success!

    Help @user spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...