javascript

Insert Script into Head using Prototype

Hi Guys, I am trying to insert jQuery into the head of a page using prototype but not entirely sure how to achieve this. Basically, I want the jQuery to appear AFTER the first tag in the head ? var script_head = document.createElement('script'); script_head.type = "text/javascript"; script_head.src = "http://ajax.googleapis.com/ajax/...

SmartGWT, appending HTML to HTMLPane

Hello, I am currently working with SmartGWT and have been trying to obtain a way of including a panel such as the gwt Standard VerticalPanel into a smart GWT window. The reason for the VerticalPanel is that I can append widgets to the verticalpanel object without having to re-set the entire content, for example: HTMLPane hPaneObj = new...

calling php file from jquery at specific interval

i have following variables in jquery var uemail="[email protected],[email protected],[email protected]"; var subj="test message"; var text="<b>This is Email Body Text</b>"; i have one PHP file named "email.php" to send email <?php $email =$_GET['email']; $subject =$_GET['subj']; $message = $_GET['text'];; if(mail($ema...

getElementById in Firefox iframe returns null but works in Safari/Chrome

I've two html files. One includes the other in an iframe. The iframe executes a getElementById on a previously created element. This works fine in Chrome/Safari but doesn't in Firefox/IE8, and I don't understand why. Firefox returns: null Safari returns: [object HTMLDivElement] index.html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01/...

window.XMLHttpRequest is undefined in IE7/IE8

Hi, Value of window.XMLHttpRequest is Undefined when i run my application even in IE7 or IE8, Is there anything i have to enable in IE7 to make it work. Thanks ...

Questions about javascript and flash

Hi, I have a website to develop for a company and, in their instructions, the website must work even the javascript is disabled. Before beginning the development, I visited this company's main website and it works even the javascript is turned off. But, they are using Flash on their main page and it still run even javascript is turned of...

Problems with fetching variable from flash with javascript in IE8

I'm creating a quiz and as a timer in the quiz I have a flash movie (an animated clock). I poll the clock every second to see if the time for the quiz has run out. The code for this functionality looks like this: (simplified) $(window).load(function() { var flashMovie = getFlashMovieObject(flashId); var timeElapsed = flashMovie...

Suspend layout during DOM interaction

Hi all In Javascript I'm clearing out the contents of a DIV and then re-populating it, is there any way to suspend layout of these elements or lock the UI until I've finished slashing away at the HTML? I don't want any messages popping up, I just don't want to see the flicker as the items are removed/added. Thanks Kev ...

What's the preferred orientation for a toggle script?

Im gonna use some kind of accordion javascript (you click a button and some content appears), Id like to know from an UI/ergonomic standpoint what's the best orientation of the expanded state? the button moves down as the content becomes visible (UP) the content beside the button (DOWN) side questions: Will the page auto-scroll...

fill variable width column(s) with fixed width/height 'items' dynamically

Hi - I have a 3 col layout (fixed center, var Left & Right side cols) and want to fill the 2 side cols with adsense ads as many as I can fit. I'm thinking dynamically generate the js to fill the columns (since I don't know how wide they could be and float the ads to fill it). But how do I detect with js that the column is filled (ads ...

Problem with jQuery AJAX requests: relative vs. absolute urls

hey there, I'm having a hard time getting my AJAX requests to work on a staging server. It all worked fine on my development machine, but as soon as I uploaded it, all my AJAX requests stopped working. I found out that, if I change the relative urls (eg. "index.php") to absolute urls ("http://mydomain.com/index.php") the requests work a...

document.body is null

I've got a page where I'm using Mootools 1.2.4 and MediaboxAdvanced as a lightbox. I can't seem to get the thing working because of a particular javascript error document.body is null at the initialization of Mediabox: $(document.body).adopt( $$([ overlay = new Element("div", {id: "mbOverlay"}).addEvent("click", clo...

Can I determine the current state of the display CSS style for a given element using JS

I wish to write a simple javascript function that toggles the visibility of a given element. Problem is, immediately after the page load, the initial style is unknown (at least to me). How can I determine what the current value of a given element's display style element is? ...

A link to redirect within a facebox (does not break out)

How can make a link within a facebox window that redirects it to another page without breaking out? I tried using an iframe which worked nicely... except the initial content I want to display in the facebox is a simple message and a link. I then want the link to redirect to a page if clicked. As iframes require a src there is no where ...

Any working example for Jeditable with onkeyup event?

Hi, Currently I am using Jeditable version 1.6.1 in my project. I am trying to use the onkeyup event for validating user entered values in the input text field. When i am trying to use onkeyup event, it is not working. I am not sure whether Jeditable supports this event or not. Could you please help me with this problem? Regards PJ ...

How to use OR condition in a JavaScript IF statement?

I understand in jQuery (or JavaScript for that matter) if you want to link conditions together you can say: if (A && B) { do something } But how do I implement an OR uch as: if (A OR B) { do something } ...

Google Analytics: External .js file

Just to confirm... file: google.js var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-11510668-1"); pageTracker._trackPagev...

Does removing elements from the DOM affect their event handlers?

If I remove an element from the DOM which has event handlers attached, and subsequently add an element with the same ID somewhere, will the new element have handlers? ...

How to link Javascript file to the model folder in Zend

Ok so Ive got this Javascript file, simply: $(document).ready(function() { $('.status').prepend("<div class='score_this'>(<a href='#'>score this item</a>)</div>"); $('.score_this').click(function(){ $(this).slideUp(); return false; }); $('.score a').click(function() { $(this).parent().parent().pa...

Order number of highlight element

Hello everyone, i need to get number of order highlighted element (by javascript, jquery): <li>A</li> <li>B</li> <li class="highlight">C</li> <li>D</li> so, in this case i want to get number 3 into my variable. Thanks ...