Using Js Includes Instead Of In Page?
Jun 13, 2010
what is the advantage of using javascript files in an includes folder rather than on page?So for example i have a javascript validation on my page, does it make a difference to the way it is execute compared to if i referenced to it rather than having the full file in my page?
View 1 Replies
ADVERTISEMENT
Aug 13, 2003
is there any other way to include a js file other than this:
<SCRIPT SRC="js.js"></SCRIPT>
i want to do it because i need to put a variable in place of js, so it would be:
res = screen.width;
<SCRIPT SRC="res.js"></SCRIPT> where variable was determined earlier.
but i dont think i can do that
View 2 Replies
View Related
Jun 18, 2001
Alright, my site is curerntly using server side includes (hoping to switch it all over to PHP soon). What I would like to do is include a different file depending on screen resolution. Does anyone know how to do this?
View 5 Replies
View Related
Nov 16, 2006
Has anyone experienced this (and found a solution)?
I have five files: a .htm that invokes four .js include files.
Only the first alert in the first include is displayed.
This only happens when I run on a client's corporate server.
I have no problems on a laptop connected to the network
or on my home PC. Any ideas? Code:
View 7 Replies
View Related
Apr 16, 2004
I have client that has 5 versions of the same site located in web viewable root folders on his server. Aside from a few minor differences such as prices, download url's and a few text and image differences, they're the same.
Just wanted to get some opinion as to how many javascript includes I can, or should, use on the site pages or if there are any strong opinions on not doing it this way.
I'd like to place a set of javascipt files in a folder within each site, then have all pages in each site call to their specific include folder. This way I'll be able to use a single set of DW templates to manage the content on all the sites.
I can't convert to php, use ssi nor create a dynamic solution since the sites are already live and rank well in the search engines, The content I'll be wrapping in the includes is not important search engine text content.
View 1 Replies
View Related
Nov 21, 2005
I was having trouble getting the object.focus() method in IE and in FF working, so came up with this workaround.
What I wanted to do was check if a textfield was numeric, if not, inform the user then select the text and set the focus back to the field.
Sound simple? object.focus() simply doesn't work in firefox or (I've been informed) IE.
Solution:
Instead of checking when the field losing focus (onblur), check when the next field receives focus (onfocus). Then call a function that gets the element index of the object, and use that index to check the element above it. Difficult to explain.
Here it is...for the textfield you want to check, put this into the next form object after it onfocus="checkNum(this)"
then put this script in the header section...
function checkNum(obj){
var idx;
//get object index
for(idx=0;idx<document.forms[0].elements.length;idx++){
if(document.forms[0].elements[idx].name==obj.name){
break;
};
};
//check for numeric
if (isNaN(document.forms[0].elements[idx-1].value)){
alert('Value must be a number!');
document.forms[0].elements[idx-1].select();
document.forms[0].elements[idx-1].focus();
};
};
But there is one problem!!! As I just found out.
If the next field is a group option, they all have the same name and so this will not work.
for those that do not know, the function isNaN is a js function that is the same as the vbscript equivalent IsNumeric.
isNaN means isNotaNumber.
Hope this helps, I know the focus() failure of JS has been the bane of many coders.
View 4 Replies
View Related
Dec 1, 2006
This is IE issue only. Firefox and mozilla doe not have this problem.
td cell in a table with a title which includes '-'(dash). If I add a
dash between Time-Time. IE intrepets as new line os somethig and the
title is displayed in 2 line like:
Time-
Time
instead of Time-Time.
Below is snippet of the code...
View 3 Replies
View Related
Sep 24, 2010
I have created a global navigation includes document. Unfortunately the drop down menus that are part of the navigation aren't working. They worked fine when they were part of the page, but now that they are separated from the page as includes the drop down menus don't appear in my test site (posted to a web server). All other content in the includes file appears and works.
View 1 Replies
View Related
Sep 24, 2010
I've got a global navigation document with drop down menus created using javascript saved as includes. These are posted to a web server and the pages that reference the includes display the graphics and some of the links, but not the drop down menus. They don't appear on roll-over.
View 1 Replies
View Related
Aug 30, 2010
I am doing some maintenance work on a classic asp web page that displays product information. I am changing how the page looks up the available quantities for the various sizes. The old method used several SQL queries to determine the number of sizes and available quantities and then used those results to build a table on the fly on the page.
My modification consists of a web service that consolidates product size availability from three different sources and delivers the data via an XML formatted return. I have also added DOM tags in the table that is built on the fly that identify each entry with the product id and size. So, for a product that has an ID of "P12345" and a size of "XXL," that corresponding cell in the table gets an id tag of "P12345_XXL."
My jQuery update statements worked just fine using this approach until the sizes included decimal numbers. My example for this is shoe sizes. A size represented by an integer (6,7,8,...,15,16,17, etc.) works fine. A half-size represented by a decimal (6.5, 7.5, 8.5,...) does not. Even though the period is contained within a string value, jQuery doesn't seem to be able to match the value with an id tag - and yes, I have verified that the two (the string that I am giving to the jquery select and the actual tag) do indeed match.
So far, the only work-around that I have come up with is to multiply numeric sizes by 10 and parse as integer values. Is this a "known issue" and is there a more elegant solution topursue?
View 2 Replies
View Related
May 26, 2011
I have a number of functions to sort, filter and highlight table rows. Until now I've assumed a header 'th' row and not worried about 'thead' or 'tfoot'. But I'm now looking to modify them so that they will work reliably with or without these extra elements.I believe rows() includes those within a 'thead' and 'tfoot' - is this correct? Does anyone have a suggestion how I could simply ignore these elements? That is, I only want my functions to work within the tbody rows? Here's one of my functions for reference.
Code:
var ApplyFilter = function (txt,tbl,col) {// filters a table by a specified column index
var theTable = document.getElementById(tbl), i, theRow, cellText;
txt = txt.toLowerCase();[code].....
View 5 Replies
View Related
Feb 1, 2011
[Code]...
when i load page it does nothing only blank page, may have code in wrong place but not sure so can someone show me a working example so i can find out what i'm doing wrong also i would like the part of page to refresh evey 120 seconds is this possibe with jquery?
View 7 Replies
View Related
Mar 28, 2010
I have a frameset like:Quote:
<frameset rows="100,*,80" border="none">
<frame src="header.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
[code]....
View 14 Replies
View Related
Aug 19, 2009
I loaded page in div , usign jquery ajax
But the page which i loaded containg this code:
HTML Code:
To refresh all page index.php to redirect it to home.php
But the problem this, it's don't refresh all page which contain the div , but it's refreshed oly in the div wuch i loaded this code in it
So i want after i load this code in index.php div , then refres all page to redirect itto home.php
View 1 Replies
View Related
Sep 24, 2009
I've got 2 pages: a current events page and a past events page the current events page loads fine as there is only about 10 events the past events page takes about 30 seconds to load and will crash if u click your mouse in the loading time.
The pages are near identical the only difference is the query that selects the events (> versus <)
The page loads immediately without:
But when i put it back in the above happens. I'm using jQuery.roundedcorners.
View 1 Replies
View Related
May 10, 2010
I am using a Jquery/PHP/MySQL login script which is supposed to display an error or success message when the user enters their username/password and also if the username/pw is successfull go to a secure page. Right now as I have it coded, this isn't working properly. Basically nothing is displayed either way.Also,wasn't sure if I just needed to replace, the ?secure-page part with the file name of the page I want to go to if successful?Here is the code as I have it now.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>[code].....
View 1 Replies
View Related
May 19, 2011
I'm trying to use the cookie plugin to remember the state of a navigation menu from page to page. Here is the snippet of code from towards the top of my page where I am including the jquery files and cookie plugin. The second part of the sample tries to determine whether the cookie exists.
[Code]....
View 1 Replies
View Related
Jun 9, 2010
I am working on a page that will load in other pages using AJAX and the .html method. Something like this :
<span id = "edit">Edit</span>
<div id = "cont">
</div>
//the click edit script
[Code]....
Unfortunately this does not seem to work, entirely. It does trigger the click event but it messes up the post for some reason. I have played around with it for the last 45 minutes or so and it seems like the click event trigger is what is messing things up, if I comment it out it works fine. Could anyone tell me why they think this is? note this is an over simplified version of my actual code, but the structure is the same.
View 2 Replies
View Related
Nov 4, 2010
On my webpage, I dynamically create an iFrame when a button is pressed, then load a html page from within my own domain into the iframe, based on what html page is loaded into a variable. My question is, can I dynamically change the font family of the loaded html page from the javascript of the main page? My code to create the iframe is:
function setSubTxt(){
var par = document.getElementById('parentDiv');
par.innerHTML = '<iframe src="'+subTxt+'" style="width: 375px; position: fixed; height: 365px; left: 400px; top: 145px; border=none;" name="subIframe" frameBorder=0></iframe>';
frames['subIframe'].window.location=subTxt;
document.subIframe.document.body.style.fontFamily = "Arial";
[Code]....
the variable "subTxt" has the url of the html page to be loaded (always on the same domain). The code: document.subIframe.document.body.style.fontFamily = "Arial"; was my attempt to dynamically change the font, but it didn't work. Also, it should be noted that there is no font family set in the html pages which would override this.
View 6 Replies
View Related
Jan 10, 2011
I have an webbpage, and in the middle of it there is an iframe to a php site. So i have used this code, so after some seconds the iframe will send the guest to another page. <meta http-equiv="refresh" traget="_top" content="5 url=http://mypage.com"/> But the thing is that i want the WHOLE page to reload, and go to that page after 5 seconds (we can say). With that code, only the iframe are going to another page. Is it possible to make the whole page send the user after some seconds, to another page and not only the iframe?
View 1 Replies
View Related
Mar 29, 2011
It is possible to perform a find in page search that looks at a specific link, opens the page in a new window and finds the text within that document?? Basically I regularly use an html page in work that has a list of people and their telephone numbers. I want to be able to type in a searchbox on my main page and it open the target page and find the name I am looking for? Is this possible or can you only Find In Page on the same page or another frame?
View 1 Replies
View Related
Apr 12, 2011
I have the following bit of jQuery:
Code:
$("#save_photos_all_continue").click(function() {
event.preventDefault();
var $black_white_all = $("#black_white_all").is(':checked');
var $color_all = $("#color_all").is(':checked');
var $other_all = $("#other_all").is(':checked');
[Code]...
In Google Chrome it works fine but in Mozilla/5.0 it actually goes to the save_edits page instead of just using the post and staying on the original page.
View 2 Replies
View Related
Jul 20, 2005
I have an html page that uses javascript to open a new window and
display a file that gets created when a button is pressed.
My problem is when the file is changed and the display button is
pressed, the old file is still displaying. I have tried using
<META HTTP-EQUIV=expires CONTENT=0><META HTTP-EQUIV=PRAGMA CONTENT=NO-CACHE>, but doesn't work 100% of the time.
View 1 Replies
View Related
Jun 22, 2011
I am trying to incorporate two javascript files (using jQuery) and they are creating a conflict.If the main js is on the page part of the page does not work. If I do not include it my menu and some related features do not work correctly.One code is long so here is the link to it: *I removed Link* (this is the main code for the menu etc)The other js is:
$(document).ready(function(){
Engine.Initialize();
if( !$('body').hasClass('index') && !$('body').hasClass('homepage') ) {[code]....
View 2 Replies
View Related
Sep 4, 2010
My requirement is, I have multiple pages in tab format. If i am on first page in edit mode and change any control's value and without saving information i click on other tab that particular time a popup should appear showing validation message say "you are moving without save and it will loos all changes either click ok to loose the changes and move to other page or click cancel to remain on the current page."I tried using var isDirty = false; var msg = 'This page has unsaved changes.Click OK to abandon the changes and leave the page.Click Cancel to stay on the page so that you can save your changes.';
$(document).ready(function ()
{
$(':input').change(function ()
[code]....
View 1 Replies
View Related
Jul 31, 2009
I've been searching for a few hours and haven't been able to find a code snippet to see if this is available. I'm attempting to pass text from my website to another website that has a form setup on it. I'd like to fill in the pertinent data for my users on the page that I load for them. I cannot make any changes to the receiving page as it is run by another company. I've pasted some of the code that is available on the receiving form.
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
[Code]....
View 5 Replies
View Related