How Do I Get 2 Scripts To Work On A Page?

Oct 19, 2005

I have 2 scripts which I need to use on my webpage. Both scripts use the "window. command and this is causing a conflict between them.

I am aware that I can remove the "window. command and put it into the "<body event to stop conflicts, but how do get both to work when the "window. is the same for both scripts? I know I can't do "<body

View 2 Replies


ADVERTISEMENT

JQuery :: Incorporate Two Files - If The Main Js Is On The Page Part Of The Page Does Not Work?

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

Works In A Html Page But Doesnt Work In Aspx Page?

Apr 7, 2010

I have a html document when i run in Internet explorer i am getting the desired output(j query working fine). But i copy pasted the same code in aspx page...the same code is not working properly...

View 9 Replies View Related

Web Page Refuses To Work In IE8?

Oct 29, 2011

I'm trying to code a website that will read data from an Excel file (stored either locally or elsewhere) and input a row of data (searched based on a Drop-Down List) into a table on the web page itself. Every time I open the page (it's currently stored on my local drive, on a laptop running Windows 7) in IE8, though, I get the error "Automation Server Can't Create Object" and nothing happens. The Excel file doesn't get opened and the table is blank. Thing is, though, I tried opening the same web page on another computer with IE6 and Windows 2000, and the Script works perfectly there.

I've been searching for a solution to this for a week, and some people suggested elsewhere that it's a problem with IE8's security settings. I lowered them as far as they'll go and enabled Running the Script Not Marked As Safe for all possible zones, same result, the Script refuses to run with the "Automation Server Can't Create Object" error. Here's the applicable lines of code:

function loadData() {
// try {
var Excel, Book;[code]...........

I'm completely stumped, everyone. Is it some obscure setting I'm forgetting to check in IE8, is my Java not fully updated, or what is it? Again, it works perfectly on my old Windows 2000 w/ IE6 computer, but not on a recent Windows 7 laptop with IE8.

View 3 Replies View Related

Using Two Scripts On Same Page / But Can Only Get One To Work?

May 26, 2011

I am using Lightbox to display gallery images and Colorbox to contain a web form. If I create separate pages for each they work separatly, but can only get one or the other to work on the same page.I don't want to change the scripts I'm using to different ones, I would like to keep them the same but just have them work together. I feel that this article is what I need to solve my problem and have played around with the code given and I obviously am not doing it right because I can't get it to work at all.

If you click 'Contact' the modal window using Colorbox works fine. However, clicking the top row of images should make them display in Lightbox.If somebody could tell me specifically what I need to do, that would be great.

View 6 Replies View Related

Duplicating Javascript To Work Twice On A Page

Sep 10, 2007

I'm trying to get a bit of javascript to work twice one a single page, what I'm trying to do is get a bunch of images scrolling, in 2 sets. If you may take a look here (The images within the "recent" and random "tabs").

What I did was duplicate the original code and edited the function names by adding "3" onto the end.


JavaScript Code:
gOverCWScroller = false;
 
function CWScroller(ulId, speed) {
 
    this.container = document.getElementById(ulId);
    this.container.Scroller = this;
    this.speed = speed;
 
    this.container.onmouseover = function(e) {
        gOverCWScroller = true;
    }
 
    this.container.onmouseout = function(e) {
        gOverCWScroller = false;
    }
 
    this.scroll = function() {
        if (gOverCWScroller == false) {
            var c = this.container.firstChild;
            var first = null;
            while (c) {
                if (c.tagName == 'LI') {
                    first = c;
                    break;
                }
                c = c.nextSibling;
            }
            var nodeSize = 78;  // Default
            var px = 0;
            nodeSize = first.clientWidth;
            if (first.style.marginLeft != '') {
                px = parseInt(first.style.marginLeft);
            }
            first.style.marginLeft = ( px - 1 ) + 'px'
            if ( parseInt(first.style.marginLeft) <= -(nodeSize) ) {
                first.style.marginLeft = &#390;px'
                this.container.removeChild(first);
                this.container.appendChild(first);
            }
        }
        setTimeout('document.getElementById('' + this.container.id + '').Scroller.scroll()', this.speed); 
    }
 
    setTimeout('document.getElementById('' + ulId + '').Scroller.scroll()', this.speed);
 
}


JavaScript Code:
gOverCWScroller3 = false;
 
function CWScroller3(ulId, speed) {
 
    this.container = document.getElementById(ulId);
    this.container.Scroller3 = this;
    this.speed = speed;
 
    this.container.onmouseover = function(e) {
        gOverCWScroller3 = true;
    }
 
    this.container.onmouseout = function(e) {
        gOverCWScroller3 = false;
    }
 
    this.scroll3 = function() {
        if (gOverCWScroller3 == false) {
            var c = this.container.firstChild;
            var first = null;
            while (c) {
                if (c.tagName == 'LI') {
                    first = c;
                    break;
                }
                c = c.nextSibling;
            }
            var nodeSize = 78;  // Default
            var px = 0;
            nodeSize = first.clientWidth;
            if (first.style.marginLeft != '') {
                px = parseInt(first.style.marginLeft);
            }
            first.style.marginLeft = ( px - 1 ) + 'px'
            if ( parseInt(first.style.marginLeft) <= -(nodeSize) ) {
                first.style.marginLeft = &#390;px'
                this.container.removeChild(first);
                this.container.appendChild(first);
            }
        }
        setTimeout('document.getElementById('' + this.container.id + '').Scroller3.scroll3()', this.speed);   
    }
 
    setTimeout('document.getElementById('' + ulId + '').Scroller3.scroll3()', this.speed);
 
}

This all works fine and dandy, however, I can only get one of the image sections to scroll. It's something to do with this:


HTML4Strict Code:
<script language="javascript" type="text/javascript">
CWScroller('scroller', 30, 'horizontal');
CWScroller3('scroller3', 30, 'horizontal');
</script>

If I leave out "CWScroller3('scroller3', 30, 'horizontal');" the recent section of images will scroll but the random images wont. If I put in "CWScroller3('scroller3', 30, 'horizontal');" it'll overwrite the the original recent section, and that won't scroll.

View 2 Replies View Related

Code To Submit The Page Does Not Work Sometimes In IE?

Dec 2, 2010

I have a jsp which has a function gets called during the page unload. This jsp has a form with an action attribute to one servlet.
below the code snippet.

---- Java script code ---
function logoff() {
document.forms["FormName"].target="_self";[code]...

But this resulted in script error while loading the page "object does not support this method or property" at line where document.observe is there.

View 1 Replies View Related

Refresh The Page For The To Work Correctly?

Nov 17, 2011

I am sorry if this is a stupid question. I have never really used javascript before. I found some code online that I tried to piece together so I might not even be going about this the right way.

I want the background to take up 100% and resize with the browser. That works fine. I also want the text "welcome to the ahi life" stick to the bottom left hand corner and the enter button to stick to the bottom right. I would like these to resize with the browser as well. It all kind of works, except the first time you load the page the text and the button are much smaller than I would like them to be. If you refresh the page everything is correct.

[Code]...

View 4 Replies View Related

Why In My Page Where Is Multiple Slideshows One Of Them Doesnt Work

Sep 19, 2011

Here is my code that im dealing with and only second sliceshow works for me i need them both that would be working together

Here is my script:

View 4 Replies View Related

Ajax :: Document.write Does Not Work In My Page

Nov 16, 2011

In my script there are two document.write lines. The problem is that when I call it from my ajax page it replaces the entire body and the page disappears.

Is there a way to call this in an ajax page?

View 5 Replies View Related

Can't Get Sliding Panel To Work On Page Load

Feb 17, 2010

Everything is working fine, except I cant get it to work on page load, regardless of the line you should just comment out to get it to work I have tried playing around with the code over the last couple of days, but I just dont know enough about JvaScript to get it to work

View 2 Replies View Related

JQuery :: Making SlideToggle Work On A Wordpress Page?

Aug 17, 2011

I'm trying to add a slideToggle to a paragraph in a Wordpress blog page. The following code works for triggering an alert, but when I replace the alert with the slideToggle, nothing happens.Here's the alert:

jQuery.noConflict();
jQuery(document).ready(function() {
jQuery("#principles").mouseover(function() {

[code]....

Taken right off a jQuery API page, inserting my own id names .The "#principles" is the id of a span of text just above a paragraph with an id of "p=principles".

View 1 Replies View Related

Make Adsense Work On Results (doesn't Appear) On The Page

Apr 28, 2009

I have been trying to make adsense work on my results on the page [URL]. I want the adsense in the results when you type something in. When I do this normally, it just doesn't appear. When I use this:

document.write('<table align=center cellspacing=0 cellpadding=0 border=0><tr><td valign=TOP align=center>');
document.write('<scr' + 'ipt type="text/javascript" >');
<!--
google_ad_client = "pub-8143092012646781";
[Code]....

View 5 Replies View Related

Scroller Works Fine On Two Of The Pages But Does Not Work At All On The One Page?

Aug 7, 2011

i am using an image scroller and i have it on three pages, the pages use the same header, the same css and the same basic structure.such as

table
content
footer

the problem is that the scroller works fine on two of the pages but does not work at all on the one page.here is what i am getting on that page

Message: 'ElementExtensions' is null or not an object
Line: 1898
Char: 3
Code: 0
URI: http://www.mysite.com/lightbox_slideshow/prototype.js


Message: Object doesn't support this property or method
Line: 705
Char: 41
Code: 0
URI: http://www.mysite.com/lightbox_slideshow/lightbox.js


Message: Array length must be assigned a finite positive number
Line: 464
Char: 5
Code: 0
URI: http:[url]....

the only common denominator i can see is that the page it does NOT work on is in fact a photo manager page, the other two (that DO work dont deal with photos)i checked the array and the js vars and stuff are different from my photo manager vars (php) so i was thinking maybe there might be a clash of some kind accessing the queries at the same time when the page loads but i dont get any errors other than these.by the way the scroller is black not grey like the others for background.does it sound like from the errors that i am getting that it might be a db query clash of some kind.

View 2 Replies View Related

How Do I Get Variables In External JS File To Work In Html Page?

Jul 14, 2007

I need help getting variables in an external js file to transfer to the html page that uses them. I have an html page that lists verses to memorize, which, when the mouse hovers over a particular verse, a small popup reveals the book reference for that verse, thus giving a check to see if the user has accurately referenced that verse for its source.

I have an external js file (VERSES.js) that houses the verses and popup references sequentially as elements in an array and then writes them to the html document. A simplifed version of what I am using, with only a few verses listed here as an example, and that works beautifully, is given below: Code:

View 6 Replies View Related

Making Script Work Multiple Times On Page

Nov 27, 2007

I had help with the following script. But, it only works with specific ID, which I have to specify in the javascript code. If I wanted to have multiple sets of selection lists, I would have to duplicate the entire javascript block, which I do not want to do.

My question is, how can I make this script not have hardcoded IDs, and let those be declared where my onchange is? Is this possible? Code:

View 2 Replies View Related

Auto Populate A Drop Box Menu From A Pop Up Page Does Not Work On IE

Oct 14, 2010

i am trying to populate a drop down menu from a pop up page. what i have its working on chrome but it does not work on IE and i was wondering if you may be able to know why. Here is my code:

[Code]...

View 2 Replies View Related

Bookmark Script For Current Page - Css Work Only From Second Click

May 21, 2011

I need to make a script when it is clicked in bookmark it must immediately mark all the pictures on the page with border css. Code for bookmark:

Code:

Inside mark_img.js I loading jQuery to current page and also immediately mark all images with css:

Code:

When I click on the bookmark I don't see any changes. And console show me:

Code:

But if I click again on the bookmark it will be work fine and draw border for all images what I need.

Question: how to set css for images with the first click on the bookmark?

View 3 Replies View Related

AJAX :: Make Work Inside A Page Called?

Jun 21, 2011

I am using a form validation class I got from the internet. Now I have a main page wherein I have a <div id="form"></div> that, using AJAX, displays other pages with forms like textboxes, etc. for a user to input. Here is the code for my main page:

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>

[Code]...

View 2 Replies View Related

Slides Down A Window With A Yes / No Box To Continue On To Another Page - Doesn't Work In IE?

Jan 31, 2011

it's a layer that slides down a window with a yes/no box to continue on to another page.

[Code]....

View 3 Replies View Related

JQuery :: Convert Dates To String To Work With HTML Page?

Dec 8, 2011

Im having to create an html page that displays the current date that i need to extract from a .JS file eg: daysOfTheWeek: [Content.dates.sunday] I have to convert this into a string to work on my HTLM page...So far i have managed to get this far

<h4>It is now </h4>
<span class="dateHolder"></span>
</head>

[code]....

View 1 Replies View Related

JQuery :: One Page Loaded Multiple Times Getting Elements By Id Won't Work?

Nov 10, 2011

My goal: I'm trying to to create a configuration dialog and persist it so the user can edit it later. Since the configuration is long and has Datepickers, Sliders, different types of inputs and such, I'm loading a new page for the configuration and using ID to get values from them. For example, the page has a datepicker text input "startDate" and a datepicker for it.My problem:1) I load theconfigurationpage into a div of home page make a dialog out of it. jQeury moves that div to it's own div that it created in the body of home page. So when I add multiple dialogs, datepicker doesn't work anymore since there are two "#starDate" input fields in the page now. I also plenty of other cases where I use the ID directly to do other tasks. Is there a way for me to go forward with this.

View 1 Replies View Related

JQuery :: Script Does Not Work For Content Async Added To Page?

Jul 29, 2010

I have spent a lot of time googling about this but I'm not sure exactly what to search for. I use jquery ajax to send a request to the server and then new content for a specific div is returned that the script then places in that div. All links with the css class "link" triggers this request.

The problem is that the returned content contains links with the css class "link" and they will not trigger the request. I'm guessing this has something to with that the script does not know about these new links that were added. Because the script runs when the page loads and only knows about the links that were on the original page.

How can I make the script ready for the new ones that are async added into the page?

<script type="text/javascript">
$(".link").click(function () {
$.ajax({
url: $(this).attr("href"),

[Code]....

View 1 Replies View Related

Integrate Lavalamp With Page - Form Validation Doesn't Work

Oct 30, 2009

I am trying to integrate with my page it worked but ever since I used this form validation the lavalamp went away: [URL] This is the link to the lavalamp: [URL] So the lavalamp should work like this: [URL] But instead it doesn't like this: [URL] and I am not sure why, also the form validation doesn't work very well at all.

View 2 Replies View Related

Refreshing Page - Refresh The Parent Window Doesn't Work In IE8?

May 9, 2011

why my simple javascript to refresh the parent window doesn't work in IE8? When the child window closed, it reopen another new window for the page I want the parent window to refresh and nothing happened on the parent window.How can I make it load the page from parent window instead of a new window ??? it works perfectly in other browsers but not IE.

Code:
<script language="JavaScript">
<!--
function rent() {[code].....

View 1 Replies View Related

Syntax - Adapt My Working Email Code To Work On A Different Page

Aug 8, 2011

Trying to adapt my working email code to work on a different page... I have VERY little javascript experience...and don't know proper syntax. I want to put this on a page that is created with a while loop (php) and has many members on one page. So it needs a unique identifier for the form (and I think each field in the form) so it will properly update back to the correct section of the while loop (instead of just the top one like it does now.).

Javascript
var thisRandNum = "<?php echo $thisRandNum; ?>";
// Start Private Messaging stuff
$('#pmForm').submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');});
function sendPM ( ) {
var pmSubject = $("#pmSubject");
[Code]...

View 3 Replies View Related







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