latvietis Posted January 27, 2015 Report Share Posted January 27, 2015 Sveiki. Var kāds palidzēt? Kā izveidot, lai automatiski, ienākot mājas lapā, nospiežas, vai ielādē pogu/divu : $stop = '<div style="float:left;margin-left:15px;cursor:pointer;" onClick="javascript:server_stop(' . $url_id . ');" title="'.$lang['stop'].'"><img src="'.$relpath.'images/icons/medium/server_stop.png" border="0" /></div>'; ? Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted January 28, 2015 Report Share Posted January 28, 2015 http://api.jquery.com/load/ Quote Link to comment Share on other sites More sharing options...
latvietis Posted January 28, 2015 Author Report Share Posted January 28, 2015 (edited) http://api.jquery.com/load/ Mēģināju divus nedaudz vieglākus veidus.. bet neviens nestrādā; <?php echo '<body onload="server_stop(' . $url_id . ');">'; ?> vai arī <body onload="server_stop(<?php echo $url_id; ?>)"> Neviens nestrādā.... Ja piemēram ielieku tikai <?php echo $url_id; ?> tad vērtība tiek izvadīta pareizi.. tik nesaprotu kapēc onload nenstrādā - bet onclick strādā... Edited January 28, 2015 by latvietis Quote Link to comment Share on other sites More sharing options...
Roze Posted January 28, 2015 Report Share Posted January 28, 2015 Idejiski pārlūkos var ieslēgt developer konsoli (parasti F12) un paskatīties vai nav kaut kādas kļūdas, bet tā uz aci šķiet ka trūkst vienkārši ' vai " pie funkcijas (pretēji sanāk, ka padod JS variabli funkcijai). Proti: <body onload="server_stop('<?php echo $url_id; ?>')"> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.