javascript - Passing variable issue -
i have livescore website , making widget out of site live results use @ client side tow lines of javascript:
<div id="widget-container" class="my_widget" width="800px"></div> <script src="http://example.com/mywidget/widget.js" type="text/javascript"></script>
i have id each user should use id proper css. server side code "widget.js":
(function() { // localize jquery variable var jquery; /******** load jquery if not present *********/ if (window.jquery === undefined || window.jquery.fn.jquery !== '1.8.3') { var script_tag = document.createelement('script'); script_tag.setattribute("type","text/javascript"); script_tag.setattribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"); var script_tag1 = document.createelement('script'); script_tag1.setattribute("type","text/javascript"); script_tag1.setattribute("src", "http://localhost/aaa/include-js/jquery_timer.js"); if (script_tag.readystate) { script_tag.onreadystatechange = function () { // old versions of ie if (this.readystate == 'complete' || this.readystate == 'loaded') { scriptloadhandler(); } }; } else { // other browsers script_tag.onload = scriptloadhandler; } // try find head, otherwise default documentelement (document.getelementsbytagname("head")[0] || document.documentelement).appendchild(script_tag); (document.getelementsbytagname("head")[0] || document.documentelement).appendchild(script_tag1); } else { // jquery version on window 1 want use jquery = window.jquery; main(); } /******** called once jquery has loaded ******/ function scriptloadhandler() { // restore $ , window.jquery previous values , store // new jquery in our local jquery variable jquery = window.jquery.noconflict(true); // call our main function main(); } /******** our main function ********/ function main() { jquery(document).ready(function($) { var txt; txt='<div id="wrapper">'; txt=txt+'<ul class="tabs">'; txt=txt+'<li id="fixtures_tab"><a href="#fixtures">hepsi</a></li>'; txt=txt+'<li id="live_tab"><a href="#live">canlı</a></li>'; txt=txt+'<li id="finished_tab"><a href="#finished">bitmiş</a></li>'; txt=txt+'<li id="program_tab"><a href="#program">başlamamış</a></li>'; txt=txt+'<li id="postpond_tab"><a href="#postpond">ertelenen</a></li>'; txt=txt+'<li id="selected_tab"><a id="f" href="#fav">oyunlarım (0)</a></li>'; txt=txt+'</ul>'; txt=txt+'<div class="tab-container">'; txt=txt+'<div id="fixtures" class="tab-content"><script type="text/javascript">get_all_today_matches();</script></div>'; txt=txt+'<div id="live" class="tab-content"><script type="text/javascript"></script></div>'; txt=txt+'<div id="finished" class="tab-content"><script type="text/javascript"></script></div>'; txt=txt+'<div id="program" class="tab-content"><script type="text/javascript"></script></div>'; txt=txt+'<div id="postpond" class="tab-content"><script type="text/javascript"></script></div>'; txt=txt+'<div id="fav" class="tab-content"><script type="text/javascript"></script></div>'; txt=txt+'</div>'; txt=txt+'</div>'; $('#widget-container').html(txt); }); } })(); // call our anonymous function
my questions :
- how send id value client server?
- how receive id on server make sql queries?
please me totally new in widget world thank you.
Comments
Post a Comment