SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile onclick not Working in Safari

    Hi pals,
    I am also in onclick problem, my code works fine in FF,OPERA,Chrome but not in Safari.My problem is this onclick.

    Code:
       1. <?php if(has_access($userarray,'view_serverdet','server')){
       2.     if (('Y' == $webpanel_ajax) && ('N' == $server_details || $usergroupid == "1")) { ?>
       3.         <span class="expand" id="exp<?php echo $server_row['id']?>" onclick="view_details('<?php echo $server_row['id'];?>','page','<?php echo $shade;?>')">+</span>
       4. <?php }
       5. } ?>
    The corresponding function like:

    Code:
        function view_details(id,from,class) {
               alert("id is:"+id);
               alert("from is:"+from);
              alert("class:"+class);
                  //some other codes
       }
    In other Browsers these values alert, but in Safari not. Why Pls Give me a solution
    ASAP.I use Safari 5.0.3 in Fedora 13 using Wine.
    I give that onclick in <span> is that the problem , advise me.
    Thankfully
    Anes P.A

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,042
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    Does changing the code to the following result in safari alerting?

    PHP Code:
    <?php if(has_access($userarray,'view_serverdet','server')){
        if ((
    'Y' == $webpanel_ajax) && ('N' == $server_details || $usergroupid == "1")) { ?>
            <span class="expand" id="exp<?php echo $server_row['id']?>" onclick="view_details();">+</span>
        <?php }
    ?>
    Code JAVASCRIPT:
    function view_details() { 
    	alert('Alert'); 
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry

    Hi Pal,

    That Simple Alert also not Working .... Any idea?

    Regards
    Anes P.A

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,042
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    Could you provide a link to the page in question.

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy

    Friend I am developing in localhost Now, so no link at all

    Thanks
    Anes P.A

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,595
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by anes_pa View Post
    Friend I am developing in localhost Now, so no link at all

    Thanks
    Anes P.A
    So how about posting the HTML then. All you posted so far is a fragment of the PHP and from that fragment it is impossible to determine what HTML results. The JavaScript only sees the HTML and so what is in the PHP is irrelevant unless it is generating the HTML incorrectly (and you can tell if that is happening by viewing the generated HTML).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Tags for this Thread

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
  •