javascript

json date object to php date

Hi, I am calling a webservice which return me back a json object. The json object encodes the date. I am trying to find a way to convert that date to m-d-Y format in php. Json object is {"DateOfBirth":"\/Date(387518400000-0400)\/"} this date is 02-15-1982. The webservice which I am calling is in .NET, and it converts the date to the...

setInterval window focus and hibernation

I've run into an odd issue. I have a javascript which uses setInterval to keep a session alive. But, it seems that if the browser is left unattended for a period (either leaving it open over night, or out of focus working in another application) the setInterval is not firing in IE and the session is allowed to expire. This does not happe...

Crockford Prototypical Inheritance... no prototype chain? No super?

Trying to understand a little more about Crockford's approach to Prototypical Inheritance whereby he essentially eliminates the constructor, thus eliminating any real possibility for a prototype chain or leveraging the idea of "super". mynamespace.object.create = function( o ) { function F(){}; F.prototype = o; return new F(...

Cycle Focus to First Form Element from Last Element & Vice Versa

Hello everyone, I have created a form with malsup's Form Plugin wherein it submits on change of the inputs. I have set up my jQuery script to index drop down menus and visible inputs, and uses that index to determine whether keydown of tab should move focus to the next element or the first element, and likewise with shift+tab keydown. H...

How to add a Lightbox to a custom DotNetNuke module

I'm working on a custom DotNetNuke module which requires the use of Lightbox. What's the best way to add the javascript necessary for Lightbox to a DNN module? Nearly all the solutions I've seen involve adding the javascript references to the skin file. Is there another way to accomplish this? I'd hate to have those javascript files ...

JavaScript settings are on but I still have issues with web sites using JavaScript.

Hello, I have two computers that are the same at home except I have installed Adobe Acrobat 9 Pro Extended on my main computer along with the 2010 Outlook (Beta). I have issues when I log into a website that uses pop up calendars to select the date. I pasted it below. I checked my other computer and it is fine. I've checked the Java set...

Setting height of text area based on text inside of it using jQuery

I have a <textarea> element in my form that has this code attached to it: $('#links').focusin(function() { $('#links').animate({ height: '100px' }, 300, function() { // done }); }); This works perfectly, when the text area gets focus it increases in height nicely to 100px. Now, I want it to shrink back down...

Get div's size with mooTools

Hello ! I have some <div id="text">abc</div>. Is it possible to get it's size using JS/mooTools (width and height) when I did not set it with CSS ? ...

Double click needed in firefox (JQUERY)

I was advised to used this because i was having a problem, a link worked in FireFox ONLY when clicked the second time. This is to display an external html in a div called leftColumn. $(function(){ $('#ulWithAllTheLinks').delegate('li a', 'click', function(e){ e.preventDefault; $('#leftColumn').load(this.href); }); }); My...

Ideas on how to handle a javascript widget?

My friend has a search engine that he wants to have a widget access that can be put on other web pages. If I send a request to the search engine, it returns an XML file. The request would look something like this: http://www.site.com/page.php?keyword=this+is+a+sample&amp;page=1&amp;num_days=3&amp;source_id=site2.com&amp;source_name=s...

How can I safely access other sibling functions and variables in a Javascript Module Pattern without accessing something in the containing scope?

I have a Javascript Object structured after the Module Pattern. I have several private function in it which are called from other sibling "private" functions. How can I access another variable/function without the potential to accidentally access a global/external variable/object/function? function doSomething() { alert("Something I...

Why does someInputElement.type = 'button'; fail in IE?

I'm stuck trying to get the following javascript to work in IE: var lastMonthBn = document.createElement('input'); td.appendChild(lastMonthBn); lastMonthBn.value='<'; lastMonthBn.type = 'button'; // Fails in IE lastMonthBn.setAttribute('type','button'); // Also fails in IE For some reason, i cannot set the input to a button, it fails....

onbeforeprint() and onafterprint() equivalent for non IE browsers (PHP, MySQL, JavaScript, HTML)

Hi all, I want to send some info back to my database when a user prints a certain web page. I can do this in IE with onbeforeprint() and onafterprint() but I would like to browser agnostic way of doing the same thing. Don't care which combination of technologies I have to use (PHP, MySQL, JavaScript, HTML) so long as it gets done. Any...

How do I change the css of a child of $(this)

I have a page of search results, each of which has an icon to add each result to a group (listed on the page in a hidden UL element: display:none;). Right now it works... but when I click on the icon for one result listing... the UL appears under every single result. I need it to only show up for the result listing that I am clicking t...

Mootools 1.2 Custom Tooltip Error - Tooltips show image before hover

Hey all, Having a bit of an issue woth mootools 1.2 Tips (cutsom tooltips) We are using Joomla with the latest update that includes Mootools 1.2 - and I have the following JS code $$('.tipz').each(function(element,index) { var content = element.get('title').split('::'); element.store('tip:title', content[0]); ...

What is the best practise to not to override other bound functions to window.onresize?

How much I dig into JavaScript, I find myself asking that much. For example we have window.onresize event handler and if I say: window.onresize = resize; function resize() { console.log("resize event detected!"); } Wouldn't that kill all other functions which is connected to the same event and just log my message in console? If so...

Add Fadein to existing CSS for mouseover link

Is it possible to take my existing css for a mouseover link with a background image, and make it fade in and out? Which is the best approach for a fadein/out? I'm already using jquery. .sendB { width: 100%; height: 125px; background: #5266EB url('/img/send.gif') no-repeat 50% 0; margin-top: 22px; float: left; } .s...

Is possible to add waypoints to Google Maps API without using JSON?

I'm on ASP.NET MVC and I'm using Google Maps API with Javascript. I send a Model to the View with one or more waypoints to add to the route. function calcRoute() { initialize(); var start = "<%= Model.StartAddress %>"; var end = "<%= Model.ClientAddress %>"; var waypts = []; waypts.push...

How to check if new Date("some date") was able to parse correctly?

I have the following code, which is supposed to try to parse a given date. If it fails, it defaults to the current date: var date = new Date(textbox.value); // Try to parse if (isNaN(date)) date = new Date(); // Default to current Now i'm using isNaN() to test if it was able to parse correctly, eg to check that new Date() didn't retu...

Must I escape forward slashes in Javascript?

In Dreamweaver the characters between a pair of forward slashes in a very simple calculation, like this: var foo = Math.round(bar/3)+Math.floor(bar/2); is read as a regex (at least by the syntax coloring). Will this break my code? Do I need to escape it somehow? ...