JavaScript - Is It Possible To Load A Page With Jquery That Uses Javascript?
Hello!
I am developing my personal website! And I am trying to implement it with JS completely. which means I need the page to be one front end page. But the back-end pages would be the ones which do the work and calculations! In other words and more explaination: I would like to have one "index.php" page that contains only a nav bar which handles the mission. Once the page load it loads with the content of "home.php" (the landing page) if the "contact" tab is clicked then I would like to load the "ContactMe.php" page content. I have done this already! but the problem is: "home.php" uses alot of javascript functions and jquery plug-ins. when I load it, it looks messy that you think the JS is disabled in your machine :-\ Note: the loading has been done with those methods: .load(), $.ajax! -> same results! The conclusion: * "home.php" * "ContactMe.php" * "About.php" Is it possible to load those pages in the "index.php" and still have their JS functions function correctly and display as if they were accessed individually? The goal that I am trying to achieve is that I make my whole website for the visitor as "One Page Site"! I am challenging myself with it though! Thank you in advance for your informative posts! Please Note that I have only put the <html><head><body> tags in the index.php and removed them from the back-end pages such as home.php, contactme.php and about.php! for that sake that it works correctly! but with no hope! Similar TutorialsI'm trying to build a gallery. So far I've used jquery for the scrolling thumbnails. The problem I am having is deciding which would be the best way to load the larger version of the thumbnails into a div? Currently I am using a jquery attribute replace, but the only problem I'm having is I want to use lightbox for the large images. Some of the images have text so they need to be big if the user would like to read them. Right now lightbox is working except that it doesn't understand what image it's on when you click on the large version. I believe this is because of the attribute replace. Here is where you can view the problem: http://www.tsutsumidaphoto.com/Mihoko/akiko3.php If you click on any thumbnail after the first then click on the large version it will bring up the first image then go from there. Any suggestions, I've tried for too long on my own! Hi I'm trying to load a part of a page (that has script in it) into another page using jquery. However, though the html loads in correctly, none of the script is working. I'm using code from http://css-tricks.com/video-screenca...namic-content/ ie. the pages all work without java (static pages) and when java is enabled, instead of going to bio.html you get taken to ..#bio.html. However if I've got any script I would like to be loaded .. ie. lightbox gallery or even a simple jav split and put back together email address hider. Any help greatly appreciated. I'm not very clued up about jquery at the moment unfortunately and though I've been trying to read and learn, alot is going over my head.. Not sure how best it is to show you the page as it's not live yet. Maybe if it helps I can upload a zip of the site. It's a simple 6 page musician site. Though my code is exactly like the css-tricks page, just that I have a lightbox on one page (which loads fine if there's no hash in the address - but when hash is there, it shows thumbnails, and when you click one, it just takes you to the larger .jpg destination page (no lightboxness etc).) Thanks When my page loads, it automatically jumps down as if it were jumping to a named anchor. It's more apparent on longer pages (doesn't replicate if page fills screen). Happening in Win FF/IE/Chrome Disabling stylish-select.js (from http://www.prismstudio.co.uk/2009/05...x-replacement/ where he used to allow comments but not anymore) fixes it, but I don't know enough Javascript to debug, would really appreciate if somebody could have a look. Good example at http://studiohodson.com/projects/Bea...restaurant.php Script is at http://studiohodson.com/projects/Bea...lish-select.js Thank you thank you! Hi - I have an ASP.Net 2.5 application and I need to call a javascript function when one of the pages loads initially. I've tried: Code: string ScriptToCall = @"EnableCheckboxes(" + cblDetails.ClientID + ", false);"; ClientScript.RegisterStartupScript(this.GetType(), "addScript", ScriptToCall, true); where EnableCheckboxes is a javascript function on the page. This doesn't work (doesn't disable the CheckBoxList), although the EnableCheckboxes function DOES work when I call it in other ways, so I'm sure that the problem is that I'm not calling it properly on page load. I've tried: Code: ClientScript.RegisterStartupScript(this.GetType(), "addScript", "alert('Hello');", true); which DOES work, so I know I'm on the right track, but how do I do this? Thanks! hello Friends In my jsp project i am using the calendar control which selects the Birth Date of the client and on that basis it calculates the age after completion of all the fields user get registered successfully.but when registered user trying to update his date of birth his age field is blank please tell me why this happening Also please tell me the javascript function My jsp code is: Code: <%@page import="java.lang.reflect.Array"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@page import="java.util.ArrayList"%> <%@page import="com.udhc.model.City"%> <%@page import="com.udhc.model.User" %> <%@page import="com.udhc.model.Country"%> <%@page import="com.udhc.model.State"%> <%@page import="com.udhc.config.ApplicationConstant"%> <%@page import="org.apache.struts.Globals" %> <%@page import="com.udhc.utility.CommanUtility"%> <%@page import="java.util.HashMap"%> <%@page import="com.udhc.form.UserForm"%> <%@page import="com.udhc.utility.DateUtlity"%> <%@page import="java.util.Calendar"%> <jsp:include page="Header.jsp"></jsp:include> <link type="text/css" href="css/jquery.ui.core.css" rel="stylesheet" /> <link type="text/css" href="css/jquery.ui.datepicker.css" rel="stylesheet" /> <link type="text/css" href="css/jquery.ui.theme.css" rel="stylesheet" /> <link type="text/css" href="css/calendar.css" rel="stylesheet"></link> <script type="text/javascript" language="javascript" src="js/jquery.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.ui.core.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.ui.widget.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.datepicker.js"></script> <script type="text/javascript" language="javascript" src="js/calendar.js"></script> <script type="text/javascript"> <% User user= (User)session.getAttribute(ApplicationConstant.UDHC_USER_MODEL); %> // Array of max days in month in a year and in a leap year function addUser() { if(validate()) { document.forms[0].method = "POST"; document.forms[0].nextStep.value = "addUser"; document.forms[0].action = "User.do"; document.forms[0].submit(); } } function updateUser() { if(validate()) { document.forms[0].method = "POST"; document.forms[0].nextStep.value = "updateUser"; document.forms[0].action = "User.do"; document.forms[0].submit(); } } function ClearOptions(OptionList) { for (x = OptionList.length; x >= 0; x = x - 1) { OptionList[x] = null; } } function AddToOptionList(OptionList, OptionValue, OptionText) { OptionList[OptionList.length] = new Option(OptionText, OptionValue); } } function getSecretQuestion() { var questionId=document.forms[0].secretQuestion.value; if(questionId== "") { alert("Select Secret question"); } else { $ajax({ type: "get", url: "Register.do", error: function(data){alert("Error");} }); } } function finish() { var countryId = document.forms[0].country.value; if(countryId == "") { alert("Please select country."); } else { $.ajax({ type: "get", url: "Register.do", data: "nextStep=getStateListByCountry&country="+countryId, error: function(data) {alert("Error");}, success: function(response) { var stateList = document.forms[0].state; ClearOptions(stateList); AddToOptionList(stateList,"","Select State"); $.each($(response).find("state"), function(i, state) { var stateId = $(state).children("stateId").text(); var stateName = $(state).children("stateName").text(); AddToOptionList(stateList,stateId,stateName); }); } }); } } </script> <% ArrayList<City> cityList =(ArrayList<City>)request.getAttribute("CITY_LIST"); ArrayList<Country> countryList =(ArrayList<Country>)request.getAttribute("COUNTRY_LIST"); ArrayList<State> stateList =(ArrayList<State>)request.getAttribute("STATE_LIST"); %> <div> </div> <input type="hidden" name="<%=org.apache.struts.taglib.html.Constants.TOKEN_KEY %>" value="<bean:write name="<%=Globals.TRANSACTION_TOKEN_KEY%>"/>" /> <div style="float: left;"> <logic:notEmpty name="UPDATE_USER"> <a href="User.do?nextStep=userHome">Back</a> </logic:notEmpty> </div> <div style="width: 700px; margin-left: 100px;" class="border"> <table class="back_img" cellspacing="5" width="100%" height="600"> <tr valign="top"> <td height="10"><h3><u>User Registration</u></h3></td> </tr> <tr valign="top"> <td> <table> <tr> <td> </td> </tr> <!--<tr> <td><b>Name:</b> </td> <td><input type="text" name="firstName" class="textfield"/> <input type="text" name="middleName" class="textfield"/> <input type="text" name="lastName" class="textfield"/></td> </tr> <tr> <td width="200"> </td> <td> First Name Middle Name Last Name</td> </tr>--> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span><b>Gender:</b></td> <td><html:radio property="gender" name="UserForm" value="<%=ApplicationConstant.GENDER_MALE %>" tabindex="1"/>Male <html:radio property="gender" name="UserForm" value="<%=ApplicationConstant.GENDER_FEMALE %>" tabindex="2"/>Female <span style="color:red;font-size:small;visibility: true">*</span> <b>Birth Date: </b> <input type="text" name="dateOfBirth" readonly="readonly" value="<bean:write property="dateOfBirth" name="UserForm"/>" ><a href="#" onClick="setYears(1900, 2013); showCalender(this, 'dateOfBirth');" > <img src="images/calendar.gif"></a> <span style="color:red;font-size:small;visibility: true">*</span><b>Age: </b> <!-- <input type="text" id='idAge' name="age" class="textfield4" ondblclick="closeCalender();calcAge();" tabindex="4" maxlength="3"></input>--> <input type="text" id='idAge' name="age" class="textfield4" onclick="pickDate(month,day,year);" tabindex="4" maxlength="3"></input> </td> </tr> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span><b>Password:</b></td> <td><html:password name="UserForm" property="userPassword" styleClass="textfield"/></td> </tr> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span><b>Confirm Password:</b> </td> <td><input type="password" name="confirmPassword" class="textfield" value="<bean:write name="UserForm" property="userPassword"/>"/></td> </tr> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span><b>Secret Question:</b> </td> <td><select name="secretQuestion" class="selectfield" style="width:220px;"> <option value="">Select secret Question?</option> <% HashMap<String, String> qHash = CommanUtility.getQuestion(); if(session.getAttribute(ApplicationConstant.UDHC_USER_MODEL) != null) { //User user = (User)session.getAttribute(ApplicationConstant.UDHC_USER_MODEL); if(user != null) { for(int i = 1; i <= qHash.size(); i++) { if((i+"").equals(user.getSecretQuestion())) { %> <option value="<%=i %>" selected="selected"><%=qHash.get(i+"") %></option> <% } else { if(qHash.get(i+"") != null) { %> <option value="<%=i %>"><%=qHash.get(i+"") %></option> <% } } } } } else { for(int i = 1; i <= qHash.size(); i++) { if(qHash.get(i+"") != null) { %> <option value="<%=i %>"><%=qHash.get(i+"") %></option> <% } } } %> </select> </td> </tr> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span><b>Secret Answer:</b> </td> <td><html:text property="secretAnswer" name="UserForm" styleClass="textfield"/></td> </tr> <tr> <td><b>Contact details:</b> </td> <td> </td> </tr> <tr> <td> </td> <td> <table> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span>Address 1:</td> <td><html:text property="address1" name="UserForm" styleClass="textfield1"/></td> </tr> <tr> <td>Address 2:</td> <td><html:text property="address2" name="UserForm" styleClass="textfield1"/></td> </tr> </table> <table> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span>Country: </td> <td> <html:select property="country" name="UserForm" styleClass="selectfield" onchange="javascript:getStateList();"> <html:option value="">Select Country</html:option> <html:optionsCollection name="COUNTRY_LIST" value="countryId" label="name" /> </html:select> </td> </tr> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span>State:</td> <td> <html:select property="state" name="UserForm" styleClass="selectfield" onchange="javascript:getCityList();"> <html:option value="">Select State</html:option> <html:optionsCollection name="STATE_LIST" value="stateId" label="name" /> </html:select> </td> <td><span style="color:red;font-size:small;visibility: true">*</span>City: </td> <td> <html:select property="cityId" name="UserForm" styleClass="selectfield"> <html:option value="">Select City</html:option> <html:optionsCollection name="CITY_LIST" value="cityId" label="name" /> </html:select> </td> <td>PIN:</td> <td><html:text property="pinCode" name="UserForm" styleClass="textfield"/></td> </tr> <tr> <td>Phone: </td> <td><html:text property="phone" name="UserForm" styleClass="textfield"/></td><td><span style="color:red;font-size:small;visibility: true">*</span>Cell:</td><td><html:text property="cellNo" name="UserForm" styleClass="textfield"/></td> </tr> <tr> <td><span style="color:red;font-size:small;visibility: true">*</span>Email: </td> <td colspan="4"><html:text property="email" name="UserForm" styleClass="textfield1"/></td> </tr> </table> </td> </tr> <tr> <td valign="top"><b>Other Relevant Information:</b></td> <td> <table> <tr> <td>Height:</td> <td><html:text property="height" name="UserForm" styleClass="textfield3"/><b>Cm.</b></td> <td>Weight:</td> <td><html:text property="weight" name="UserForm" styleClass="textfield3"/><b>Kg</b></td> </tr> <tr> <td>Blood Pressu </td> <td><html:text property="bPSystolic" name="UserForm" styleClass="textfield4"/> <html:text property="bPDiastolic" name="UserForm" styleClass="textfield4"/><b>mmHg</b></td> <td>Pulse rate:</td> <td><html:text property="pulseRate" name="UserForm" styleClass="textfield3"/></td> </tr> </table> </td> </tr> <logic:empty name="UPDATE_USER"> <tr> <td> </td> <td align="char" colspan="2" rowspan="2"><a href="javascript:addUser();"><img src="images/Register1.png" border="0"></img></a> <a href="index.jsp"><img src="images/Cancel1.png" border="0"></img></a></td> </tr> </logic:empty> <logic:notEmpty name="UPDATE_USER"> <tr> <td> </td> <td align="char"><a href="javascript:updateUser();"><img src="images/update.png" border="0"></img></a> <a href="User_Home.jsp"><img src="images/Cancel1.png" border="0"></img></a></td> </tr> </logic:notEmpty> </table> </td> </tr> <logic:messagesPresent message="true"> <tr> <td colspan="2" align="center"> <html:messages id="message" message="true"> <div class="error"> <bean:write name="message"/> </div> </html:messages> </td> </tr> </logic:messagesPresent> </div> </table> <table id="calenderTable"> <tbody id="calenderTableHead"> <tr> <td colspan="4" align="center"> <select onChange="showCalenderBody( createCalender(document.getElementById('selectYear').value, this.selectedIndex, false));" id="selectMonth"> <option value="0">Jan</option> <option value="1">Feb</option> <option value="2">Mar</option> <option value="3">Apr</option> <option value="4">May</option> <option value="5">Jun</option> <option value="6">Jul</option> <option value="7">Aug</option> <option value="8">Sep</option> <option value="9">Oct</option> <option value="10">Nov</option> <option value="11">Dec</option> </select> </td> <td colspan="2" align="center"> <select onChange="showCalenderBody(createCalender(this.value, document.getElementById('selectMonth').selectedIndex, false));" id="selectYear"> </select> </td> <td align="center"> <a href="#" onClick="closeCalender();calcAge();"> <font color="#003333" size="+1">X</font> </a> </td> </tr> </tbody> <tbody id="calenderTableDays"> <tr style=""> <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td> <td>Thu</td><td>Fri</td><td>Sat</td> </tr> </tbody> <tbody id="calender"></tbody> </table> <jsp:include page="Footer.jsp"></jsp:include> I have a question is it bad or what are the disadvantages of doing what I am going to explain. I want to put the same javascript file two time in the same page e-g Code: <script type="text/javascript" src="http://www.mydomain.com/javascript.js"></script> <script type="text/javascript" src="http://www.mydomain.com/javascript.js"></script> Now many people will ask why would I want to do that, well the reason is that I am using blogger and blogger doesn't let me see all code from which the page is made rather split it into two parts named as POSTS and EDIT HTML. So I am going to place this script in those both areas but at the end when the page loads it is actually going to two the same script two times which is not error. Another question would be why am I not using same script in one place rather than two places if at the end the page code is going to become one. Well the answer would be because that script is used by other scripts too so I CAN'T CHANGE THE LOCATION if I do so, then the script stops working. Hi There, Below is some very basic html/javascript that asks for a user to enter a number in an input text box and then a button is pressed it writes out a line that number of times. It works, but when run in firefox the pages always seems to continue to load... that is, the cursor is continuously that when a page is loading (an arrow with a little circle) and the status bar in the bottom right hand corner seems to be always be at zero. It seems to be something in the for loop as when this is take out it works. Seems to work in IE however? Any ideas? Is this a FireFox thing or am I not terminating the loop properly? Code: <html> <head> <script type="text/javascript" language="javascript"> <!-- function writeloop(){ var noTimes = document.theForm.theAmount.value; for(x=0;x<=noTimes;x++){ document.write("A line!"+"<br />"); } } function cleantext(){ document.theForm.theAmount.value=""; } //--> </script> <title>Write Loop</title> </head> <body> <form name="theForm" action="#"> <input type=button value="Press me" onclick="writeloop();" /> <br /><br /> Enter the amount of times:  <input type=text name="theAmount" value="blah" onfocus="cleantext()"/> </form> </body> Many thanks! Hello, I don't know if this can be done in Javascript, or requires any other language but i was wondering if this would be possible. I would like to embed this Javascript code in to a PHP file and then for it to run automatically upon the PHP file loading: Code: <td class="smallDesc"> <a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> </td> The Javascirpt is the Facebook Share button that basically allows users that have Facebook to share the page there currently on in their Facebook status by pressing the button, but if there not logged in it shows the login page, not a problem just continue the script. The current button i which is what i want to load automatically in the PHP file is located here, to test the functionalilty just click "Share" button in blue.. http://watch-movies-online.anyfilman...-Movie-17.html To summarise, i would like the above Javascript code to execute automatically upon pageload of this PHP file.. http://www.watch-movies-online.anyfi...p://google.com. If that could be done, and if this also is possible.. i would like for the "Share" button on the external page that is loaded from the Javascript code above to be clicked automatically so in effect when ever someone visits the PHP page after clicking "Click Here to Watch/Stream 2012 Online For Free" on this page it will automatically load the Facebook Share box, and automatically click the "Share" Button and then close the page if possible, but not required. Please feel free to ask any questions, i'll be happy to answer. Thanks in advance. Best Regards, Jonathan. I have a php file lets say file1.php, that printing a variable, its dynamic numbers output that already always increasing, like private message numbers that coming or others : PHP Code: <?php echo $variable ?> i want to put that variable output, in another files page title, lets say file2.php or file3.html, in the front of the another files page titles, and auto refresh every x seconds, maybe like this : Quote: (1) - another text in the page title after x seconds, get a private message Quote: (2) - another text in the page title after another x seconds, get another private message Quote: (3) - another text in the page title or its ok if just like this, only the variable, without the another text in the page title Quote: (1) please share your knowledge to make it, maybe using javascript, jquery or others Hi all Is there a way to get the image(s) to load into the table after the page has loaded instead of the way I have it now? I have 4 tabs, but I would like the imgs in tabs 2,3,4 to load after page load. Example of how the tabs look. Code: <div class="tabbertab"> <h2>Australia_____</h2> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFCC"> <caption class="highlight_Red">澳洲 Australia </caption> <tr> <td><a href="pages/promotion.html#aus_ACE" rel="nofollow" target="_blank"><img src="pages/images/Pics/AUS/ace.jpg" alt="ACE / ATTC" width="110" height="69" border="0" align="left" class="ozimg_L"/> ...a few more images etc the other tabs look the same. LT I am having trouble with a plugin not working, so I contacted the creator, and they said the below. I have no idea how to do what they want. Can anyone help me out? "Hi The Billboard Family, We just took a look at your output. It looks like you have jquery loading 3 times, which is not good. This will cause most all jQuery plugins/code to break if you load the jquery library more than once. It looks like you have it loading with your "Enhanced Search Box" and then again at the end of your head just before your "Cycle.All" script. Please be sure that the PHP method wp_head() is that LAST piece of code running before your close head tag in your header.php file as well as wp_footer() being the LAST piece of code running before your close body tag in your footer.php file. I would also recommend running WordPress' wp_enqueu_scripts() method, detailed here by Jamie: http://getsatisfaction.com/slidedeck/... Once you get those changes made and jQuery running only once please let us know if you are still having problems. Cheers! " MY SITE: http://billboardfamily.com/?page_id=4 Hello , here is my code(which is not working on my problem) i want to remove anchor tag(href="a") will u please help.... Code: <html> <head><title>Welcome to DevForum</title></head> <script language="javascript" type="text/javascript"> function Remove() { var anchor = document.getElementsByTagName("a"); var i; for(i=0;i<anchor.length;i++) { var anc=anchor.item(i); var href=anc.attributes.getNamedItem("href"); if (href.value == "a") { anchor.item(i).attributes.getNamedItem("href").value = ""; } } } </script> <body onload="Remove()"> <h1>Welcome</h1> <a href="b">b</a> <a href="a">a</a> </body> </html> Thanks in Advance.... Hello, i would like to advise me on sthg. I have built a website using a)MySQL b)HTML c)PHP and d)Javascript. My website consists of basic html pages/templates which have links to the left and point to another templates/pages. For example, i have 4 templates in my site 1st template is for: News 2nd : Library 3nd : Articles 4th : E-shop Each template consists of 1. a small menu with links,every link points to another page 2.space for the content/text of the html page 3. a form for searching in the website using php and a mysql database. Well, i'm thinking of adding some animation in my website using the jquery library.Let's say we have an accordion which has 4 choices and when the user clicks on the first choice the 1st template(NEWS) appears inside the slide of accordion,loads in the same slide, not in a new page!!!This is what i would like to do, place in each slide of the accordion one of my templates. CAn this be done??? Which are the disadvantages of adding in each slide of the accordion a different template for my site and remain in the same slide when the user clicks in one of the links of the template??? Consider that i'm using dynamic content and not static, i have a MySQL database behind. Also,as i have seen in most examples the options of accordion usually contain an image, a content, a text or links which open in a new window or tab not inside the slide!!!These links do not load in the same slide!!i would like to have a template which loads in the slide each time the user clicks on a link of it. CAn this be done?? I would be glad if sm could advise me! Thanks, in advance!!! This script displays a link to a registration/login form that loads in a light box for Joomla. I've been goin nuts trying to figure out how to get this to load on page load with a delay. Anyone know how to get this done? PHP Code: <?php JHTML::_('behavior.mootools'); $document = JFactory::getDocument(); $document->addStyleSheet(JURI::base() . 'media/system/css/modal.css'); $document->addScript(JURI::base() . 'media/system/js/modal.js'); $document->addScriptDeclaration("window.addEvent('domready', function() {SqueezeBox.initialize({});});"); $user = & JFactory::getUser(); $uri = JFactory::getURI(); $url = $uri->toString(); $return = base64_encode($url); ?> <div id="lbframeid" style="position:absolute;top:1px;left:1px;height:0px;width:0px;overflow:hidden"> <a href="http://www.wowjoomla.com/"><h1>Joomla Login LightBox powered by WowJoomla.com</h1> </a> </div> <?php if ($user->get('guest')) :?> <a href="<?php echo JRoute::_('index.php?option=com_loginbox')?>" onclick="SqueezeBox.fromElement(this); return false;" rel="{handler: 'iframe', size: {x: 660, y: 500}}"><?php echo JText::_('SIGNUP_LOGIN')?></a> <?php else: ?> <?php echo JText::sprintf( 'HINAME', $user->get('name') ); ?> <br> <a href="javascript:void(0);" onclick="LB_onLogout(); return false;"><?php echo JText::_('LOGOUT')?></a> <?php endif; ?> <script type="text/javascript"> function LB_onLogout() { var form = new Element('form'); form.setProperty('method', 'POST'); form.setProperty('target', '_self'); form.setProperty('action', 'index.php'); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'option'); input.setProperty('value', 'com_user'); form.appendChild(input); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'task'); input.setProperty('value', 'logout'); form.appendChild(input); var input = new Element('input'); input.setProperty('type', 'hidden'); input.setProperty('name', 'return'); input.setProperty('value', '<?php echo $return; ?>'); form.appendChild(input); $E('body').appendChild(form); form.submit(); } </script> Hello. My goal is to load the JS for a specific element before displaying that element. I integrated a third part script, and it works well. I set the timer he The JS is in my heading as <script type="text/javascript" src="countdownpro.js"></script> About mid-body I have: <span id="countdown1">2010-07-20 00:00:00 GMT+00:00</span> which allows for the setting of a target date to countdown to. When the page first loads it shows the above long format target time, until the js/meta tags kick in to modify it to just show the actual countdown as 00:00:00. I have attached countdownpro.js to this post. I tried shifting the function CD_Init() to the top of the script, and also appended it inline with the .html. I tried setting the big external script to "defer", but neither arrangement worked. I also tried placing the src file right at the top. I appreciate your help. Hi All, Im new to this forum...need some of your help and advice. I have a js code like this : <script type="text/javascript"> <!-- var sipPos = 0; $(document).ready(function() { $("#panel-tab").click(function(e) { //if(autoTimer) clearTimeout(autoTimer); //autoTimer = null; e.preventDefault(); $("#panel").animate({ left: sipPos }, 1764, 'linear', function() { if(sipPos == 0) { sipPos = -856; } else { sipPos = 0; } }); }); }); --> </script> what it does is that it hide and show a panel by slidint it to the left. But my client want that on page load the panel opens automatically for about 2-3 seconds just to let users know that its here. So ive written this : <script type="text/javascript"> <!-- var sipPos = 0; $(document).ready(function() { var autoTimer = null; autoTimer = setTimeout(function(){ $("#panel").animate({ left: sipPos }); autoTimer = setTimeout(function(){ $("#panel").animate({ left: sipPos = -856 }); }, 2000); },1000); $("#panel-tab").click(function(e) { //if(autoTimer) clearTimeout(autoTimer); //autoTimer = null; e.preventDefault(); $("#panel").animate({ left: sipPos }, 1764, 'linear', function() { if(sipPos == 0) { sipPos = -856; } else { sipPos = 0; } }); }); }); --> </script> But when the panel finished showing the button to open it again doesn't work...any help please..really urgent. thks //Sam Hi guys, I am trying to insert the following call into my page; Code: <script type="text/javascript" defer="true"> $('#query').autocomplete({ serviceUrl:'service/autocomplete.ashx', minChars:1, delimiter: /(,|;)\s*/, // regex or character maxHeight:400, width:250, deferRequestBy: 0, //miliseconds params: { country:'Yes' }, //aditional parameters // local autosugest options: lookup: ['January', 'February', 'March', 'April', 'May'] //local lookup values }); </script> It works fine in all browsers except ie(6,7,8) Code: Internet Explorer can not open website. Operation Aborted. I understand it is caused by the jquery autocomplete function loading before the page / DOM has fully loaded. I tried adding Defer="true" to the script however this doesn't seem to work. Could someone please tell me what i must add to the script so that it loads after the dom has fully loaded? Thanks guys George On this website... http://livedemo00.template-help.com/...21/index.html# When you click on the Navigation Bar the website pages load inside that page? How exactly would i go around doing this? Thankyou Hello Basically I have found and adapted the code: Code: alreadyloading = false; nextpage = 2; $(window).scroll(function() { if ($('body').height() <= ($(window).height() + $(window).scrollTop())) { if (alreadyloading == false) { var url = "page"+nextpage+".html"; alreadyloading = true; $.post(url, function(data) { $('#projectscontainer').children().last().after(data); alreadyloading = false; nextpage++; }); } } }); I want when the user scrolls to the bottom of the page for content in a new page to load under the div "#projectscontainer". So in the new page 'Page2.html" I have put 5 divs going down with content in... I want the new content to appear below "#projectscontainer'" Why won't this work? Anyone know? Thanks Hello Bit of a nightmare scenario but, the services page isn't loading and from what I can tell, IE 6,7 & 8 are throwing up the same error. It says: Line: 602 Char 5 Error: 'undefined' is null or not an object Code: 0 which refers to: vmlSegments.push('m'); if (glyph.o) { The page is here The script it is referring to is typeface.js: http://typeface.neocracy.org/ Hope someone can be a great help and tell me how I can get page loading again. All the other pages are fine. p.s. I'm not a coder but designer and hoping to get this fixed myself. Thank you. |