same origin policy - How to put multi JavaScript function in a page? -
here again full code use without css, want run these 2 javascripts, can send me full code edited?
here demo page http://iscree.orgfree.com
here have jquery-1.4.2.js works both codes when in specify pages, not same page!
<script type="text/javascript" src="http://www.iscreen.orgfree.com/js/jquery-1.4.2.js"></script> <style type="text/css">a {text-decoration: none}</style> <!here js1----------> <script type="text/javascript">//<![cdata[ $(window).load(function(){ jquery(document).ready(function(){ jquery('#hideshow').live('click', function(event) { jquery('#content').toggle('show'); }); }); });//]]> </script> <!here js1----------> <!here js2----------> <script type='text/javascript'>//<![cdata[ $(windows).load(function(){ // optional code hide divs $("div").hide(); // show chosen div, , hide others $("input").click(function () { $("#" + $(this).attr("class")).show().siblings('div').hide(); }); });//]]> </script> <!here js2----------> <!here example1----------> click button make visible:<br /><br /> <input type="button" value="one" class="one" /> <input type="button" value="two" class="two" /> <input type="button" value="three" class="three" /> <input type="button" value="four" class="four" /><br /><br /> <div id="one">one</div> <div id="two">two</div> <div id="three">three</div> <div id="four">four</div><br/><br/> <!here example1----------> <!here example2----------> <a href="#" id='hideshow'>here</a> <div id='content' class="content" style="display: none;"> <div id="container" style="width:300px"> <div id="title" style="background-color:#161616;"> <center><h1 style="margin-bottom: 0; color: white;">iscreen desktop</h1></center> </div> <div id="row1left" style="background-color:#636262;height: 150px;width:150px;float:left;"> <center><a href="#" class="topopup">some text</a></center> </div> <div id="row1right" style="background-color:#161616;color: white;height: 150px;width:150px;float:left;"> <p>content goes here</p> </div> <div id="row2left" style="background-color:#636262;height: 60px;width:150px;float:left;"> <center><form name="tokey"><input type="text" name="key" onblur="if (this.value == '') {this.value = 'kerko';}" onfocus="if(this.value == 'kerko') {this.value = '';}" value="kerko" size="10"><input type="button" onclick="tokey()" value="go"></form></center> </div> <div id="row2right" style="background-color:#161616;color: white;height: 55px;width:150px;float:left;"> <center><a href="logout.php"><img src="./users/desktop/img/shdown.png" height="19" width="19"> <font size="5" style="color: white">shkyqu</font></a></center> </div> <div id="footer" style="background-color:#161616;color: white;clear:both;text-align:center;"> smkproduction.eu5.org</div> </div> </div> <!here example2---------->
simply put them in document.ready
$(document).ready(function () { jquery('#hideshow').live('click', function (event) { jquery('#content').toggle('show'); }); $("div").hide(); $("input").click(function () { $("#" + $(this).attr("class")).show().siblings('div').hide(); }); });
Comments
Post a Comment