javascript

Getting a hidden field from an Iframe into container page.

Hi, I have an ASP page that contains an iframe. I'll call it the main page. I need to set a hidden field's value in the main page once the iframe has finished loading. The iframe is an ASP page that has a hidden field that is set during its page_load. It then needs to pass this value into a hidden field on the main page. I have an onLoa...

SESSION variable show before its defined.

Hello. Im standing out with a issue, that the SESSION variable is "showing" before its defined.. Index.php is my site, where there is a design and inside that there is a frame. Now, index.php have this: <div id='message2' onclick="closeNotice2()" style="display: none"> <? echo $_SESSION["user_message_123456"]; ?> </div> Inside the f...

JS/jquery why doesn't this work?

function checkSession(){ $.ajax({url: "session.php", success: function(data){ if( data == 1){ var postFilen = 'msg.php'; $.post(postFilen, function(data){ $("#msg").html(data).find("#message2").fadeIn("slow") } } else { $('#message2').hide(); ...

Ecmascript in XHTML or SVG

Which is better? To use Ecmascript inside your SVG which is embedded in XHTML sent as application/xhtml+xml or to use Javascript (ecmascript) inside the XHTML within which the SVG to be manipulated is embedded? It feels better to use it inside the SVG, but that's just me. Is there any actual value in any of the methods or are they the s...

jquery cross browser copy text to textbox issue

Dropdown In my site I have a set of SELECT dropdowns that are set up like this. <OPTION class="addTitleTag">400</OPTION> Search Box There is also a search box that is like the following. input type="text" class="textbox" onblur="search_SearchBlock_blur()" onfocus="search_SearchBlock_focus()" value="Search" name="g2_form[searchCrit...

JQuery: .each how to reference matched object

how do i get a reference to the element that matched? 'this' is not correct. For example here I am trying to alert with the elements value. //how do i get this to reference the object it matches. $("#txtFirstName,#txtLastName,#txtDOB").each( function() { alert(this.val()); } ); ...

Detect what javascript function is changing a page element on load?

Hey! I have lots of jquery that is running on page load and it's causing one of my elements to disappear (making it style=display:none;). I'm guessing the jquery hide() function is being applied to this element by mistake, but I can't find out which statement is causing it. Is there any javascript,firebug,etc function or tool that will ...

JS to jquery to the fullest

hello. I have this: function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_type = new ActiveXObject("Microsoft.XMLHTTP"); }else{ request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); var nocache = 0; function insert() { doc...

Is there any reason NOT to use src="//domain.com/file.js", which is protocol dynamic?

In some of my E-Commerce applications I've started using src="//domain.com/file.js" in cases where I needed to reference externally hosted scripts that I wanted to include. In my E-Commerce applications not all pages actually use https as not every page has a form. I'm wondering if there's really any disadvantage to always using this, a...

Not able to load MicrosoftAjax.debug.js

I have an ASP.NET 3.5 web application which works perfectly fine on my local machine and when I deploy it on my Windows 2008 server. I am getting the following javascript error: Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned fro...

Calculating the time between two clicks in Javascript

Hi everyone, I want to calculate the time between two clicks of an attribute with javascript but I don't know how. For example; <a href="#">click here</a> if the user clicks more than once -let's say in 5 seconds- I want to display an alert. I'm using jQuery if that helps. I don't know much about javascript but I've been coding a sm...

How can you use jQuery to do something to a certain string in the page text?

Is there a way to use jQuery to search a <p> and do something to each occurrence of a string. For example make every string "magic" in the page bold? Is there a way to do it for a character so that every 'a' could be made bold? It appears contains just gives the element that contains the text and not the string itself. ...

Jquery select value passing

Hello. How do I get current value of an html select then pass it to another html select after a "click" event via jquery? Thanks. ...

if ($('#selector').length == 0) doesn't work in IE7 and IE8

Here is my jquery code: $(document).ready(function() { if ($('#login').length == 0) { $('#login').css('background', "url('/css/login-bg.gif') 2px center no-repeat"); } if ($('#password').length == 0) { $('#password').css('background', "url('/css/password-bg.gif') 2px center no-repeat"); } $('#login'...

Javascript - Scriptaculous - Effect Callback function

I am using scriptaculous to perform a slidedown effect using the following code: Effect.SlideDown('dom_element_id'); I then hide the button which initiates this effect using: $('button_id').hide(); The issue is that the button is hidden before the animation effect is complete, I would like it to hide after the animation effect is com...

jQuery Ajax security for auto suggest script

I am working on some auto-suggest feature. The script is fairly itself. When a character is typed in to the textbox it sends a ajax post (or get) request to the php file which queries the database and returns a result set. But the problem is that the php file is accessible on its own. So it can be called directly. Is there a way to pr...

Google Maps in Drupal: reference to gmap object from JavaScript

Is there a way to obtain JavaScript references to the Google maps that are embedded into Drupal pages by the GMap module? I want to be able to manipulate the maps in these pages. I want to pan and zoom them. But I cannot find a reference to an embedded map object. I've dissected the relevant JavaScript objects Drupal.gmap and Drupal.sett...

is any difference between running <script></script> and function() javascript ?

``hi, using whizzywig wysiwyg editor y found that having enter code here makeWhizzyWig("edited", "all"); is ok but running <script> function doit(){ makeWhizzyWig("edited", "all"); } </script> doit() it breaks.... any suggestion about this difference? also i will appreciate some kind of explanation about...

set the height of a container to hold dynamically-sized widget

Here's an example: http://la.truxmap.com/marker?id=thesweetstruck&amp;t=1267058348000 The widget on the right usually overflows unless i set the height of the container to some fixed size like 1800px. What I want to do is have the div with the white background (container) always span AT LEAST until the bottom of the widget. I don't w...

how to access element whose id is variable

I need to access elements in html file using javascript, their names are like arr_1, arr_2, arr_3, i wish to use a loop to dynamically create the id then to access them like below: for(var i=0; i< 10; i++) { var id = "arr_" + i; $document.getElementById('id').... } but it doesn't work. i remember there is an function to allow me...