Includes

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


ADVERTISEMENT

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 View Related

Conditional Includes?

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

Multiple JavaScript Includes Fail

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

JavaScript Includes Performance Question

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

IsNumeric? Includes Object.focus() Workaround

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

IE Issue : Td Cell In A Table With A Title Which Includes '-'(dash)

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

Server Side Includes / Drop Down Menus Not Working

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

Drop Down Menus In Server Side Includes Not Working?

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

JQuery :: DOM Tag Not Found When Select String Includes A Decimal Point / Fix It?

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

Ignore Thead, Tfoot And Tbody - Rows() Includes Those Within A 'thead' And 'tfoot?

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







Copyrights 2005-15 www.BigResource.com, All rights reserved