javascript

How to properly work _around_ Javascript persistence?

There is basic persistence of Javascript vars/etc. You call a function/method, and the next time you call that same function/method, it is holding the data from the last time. You can delete the vars when you are done with them, but that removes the advantage of using the code again for that instance. So what is the proper way to write...

Icefaces actionListener Issue

Hi All... I'm facing a problem with Icefaces ActionListener.... I need to prevent the actionListener to be fired while i still in client... In another way : I need to check a boolean expresion in javascript before the actionListener is fired, if my boolean expresion return false i want not to fire the actionListener, and if the result is...

Consume WCF with JavaScript but keep it generic enough for all clients?

I want to create a web service for my clients so they can display their data on their own web sites. Since I will not know what platform each client is running, what would be the best solution to create a proxy to the WCF service that can be used by all browsers? Also, I am not sure how I should present the data. Let's assume my users do...

window.location.hash issue in IE7

We have a javascript function that should "move" a page to a certain position using anchors. This function just does window.location.href = "#" + hashName. This works in FF, but not in IE. I tested this code using IE7 under Windows XP. I have tried using window.location.href, window.location.hash, window.location.replace and all these w...

Should I bring HTML snippets or JSON?

Please note: this is not exactly same as this question. Although it looks like that, I have some very specific requirements. In my application, I have two panels to update with a single AJAX request. Currently, I am sending JSON, and constructing two DOMs in JS and appending them in corresponding places. This is becoming difficult to m...

'overriding' javascript function

I need to add some validations before the user navigates away via an ASP.NET Menu. I noticed that the items are rendered to use a javascript function called Menu_Key <td id="ctl00_MainMenun1" onmouseover="Menu_HoverStatic(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)"> I there a way to override that function and have...

Least memory intensive DOM element

I want to render some 4000 odd DOM elements using Javascript. Do all DOM element consume the same memory within the browser? For e.g. between SPAN, DIV, A, etc. are they all the same memory wise? ...

How to access parent Iframe from javascript

Well, I have an IFrame, which calls a same domain page. My problem is that I want to access some information from this parent Iframe from this called page (from javascript). How can I access this Iframe? Details: There are severals Iframes just like this one, that can have the same page loaded, because I am programming a windows environ...

How do I access the onresize event from a SharePoint Web Part?

I have some JavaScript that will execute within a SharePoint web part. I would like to have a function execute when the window is resized. Normally I would use <html> <body onresize="resizeFunction();"> </body> </html> but in SharePoint things start to get hairy. I have an onload function that I am able to use thusly: _spBodyO...

date problem in javascript

hello, I've a problem with date in Javascript. I need to increase by 1 day a date and I'm using this: var myDate = new Date(); myDate.setDate(myDate.getDate() + 1); but when is the 30th of june the increased date will be the 31th of june and not the 1st of lst of july. how can I obtain a correct increased data??? ...

Google Maps API - Map no longer displays

Hello, I setup a directions page for a small company that I do work for. It has a few markers and lets people get directions to the location from wherever they are. For some reason, the page decided to stop coming up in the browser. I've done just about anything I could think and nothing has worked. I'm not the best at javascript but I...

IE8 - window.open() - "No such interface supported"

When I call window.open() from JavaScript, I get the error dialog with the message "Line: xxx Error: No such interface supported" Google leads me to websites referring as far back as IE4 saying that I need to run regsrvr32 on several DLLs. Is there a better solution? EDIT: exact code requested <html><head> <script type="text/javascri...

Display multiple QT videos same page

I am using this to display a video, and it works great: <DIV ID="video"> <DIV ALIGN="CENTER" ID="video"> <P ALIGN="CENTER"><SCRIPT type="text/javascript"> // <![CDATA[ var myQTObject = new QTObject("cyclick.jpg", "courtyard", "400", "290"); myQTObject.addParam("href", "courtyard.mov"); myQTObject.addParam("autostart", "false"); myQTO...

Programmatically determine DPI via the browser?

Hi all. I would like to programmaticaly determine the DPI of a user's display in order to show a web page at a precise number of units (centimeters/inches). I know it a weird request: it's for a visualization research project and it's kind of a control. We currently do it by having the user place a credit card to the screen and match a r...

jquery changing innerhtml of a P isn't working

Hi there, I have what I thought was a simple select with jQuery to change some text on a paragraph. It works perfect the traditional way i.e. document.getElementById('message_text').innerHTML = "hello"; But with jQuery it doesn't. I have checked the values of $('#message_text') and sure enough I see the items. $('#message_text').in...

Stop an executing jquery and then resume where it left...

Well, I am using this jquery carousel plugin...and it works just fine (it has automatic carousel enabled), however I am trying to make it stop when any user runs a mouse over the carousel and then trying to resume where it left, after the mouse is out. I have not yet managed to do this, and I'm not even sure how to continue trying. This ...

Javascript convert "05/27 11:00pm" to date?

How does one convert a string of a date without a year to a JS Date object? And how does one convert a date string with a year and a time into a JS Date object? ...

jquery buffer/queue for effects? Or to tell if an effect is in process?

Hi there, I have a click event that checks to see if a form is correct i.e. filled out details.. and then i call a function that does this $('#message_text').html(text); $('#message_system').fadeIn("slow"); $('#message_system').animate({ opacity: 1.0 }, 5000) .fadeOut('slow', function() { $(t...

Can I tell anything about a hyperlink that was clicked in JavaScript?

If I have code like this: <script> function determine() { // ???? } </script> <a href="blah1" onclick="determine()">blah1</a> <a href="blah2" onclick="determine()">blah2</a> Is there a way in determine() to see which link was clicked? (Yes, I know, the easy and correct thing to do would be to pass "this" to determine()...but in ...

Best way to link to external scripts in Document HEAD

I've noticed many sites use this, without closing the tag. <script type="text/javascript" src="editor.js"> This style is also recommended but is longer: <script type="text/javascript" src="editor.js"></script> Can I write it like this? Is it valid or is there a better way? <script type="text/javascript" src="editor.js" /> ...