javascript

Assigning console.log to another object (Webkit issue)

I wanted to keep my logging statements as short as possible while preventing console from being accessed when it doesn't exist; I came up with the following solution: var _ = {}; if (console) { _.log = console.debug; } else { _.log = function() { } } To me, this seems quite elegant, and it works great in Firefox 3.6 (including...

Dumping out Value on console using jQuery

Hello, I come from PHP background and am used to doing var_dump, echo and print_r while doing some kind of debugging. I have just started on jquery, today is my first day infact and am trying to see if there is a way to dump out value to firebug console. Do we have similar function to var_dump or echo in jQuery or any other way to ...

javascript: ignoring case sensitivity of strings

In JavaScript, I'm trying using the user's input to search my database. For example, user input is "monster", and my database's data is "Monster". How can I have it match regardless of it's casing? ...

debugging with internet explorer

I have some code that I thought I had written so that it would play nice on IE. But apparently it does not. I use IE8 for my testing and get quite frustrated with the built-in debugging 'tool'. I found that firebug has a javascript tool that debugs for IE but I have to click it for every page, wait for it to load and then test my scri...

jquery arguments.callee

I'm trying to adjust a jquery script to my needs and encountered the following lines- arguments.callee.eabad1be5eed94cb0232f71c2e5ce5 = function() { _c3(); _c4(); return; }; what is it? ...

How do I enable enter key submit?

So two questions here: If I use <input type="button" onclick="validate()"> then the enter key wouldn't work. However, I can use type="submit" but how would I invoke validate()? ...

dhtmlx grid in xhtml page

I need the dxhtmlgrid to work in a xhtml page. All the examples are in plain html and when I try and convert to xhtml I get errors. Can anyone help me get a dhtmlxgrid to work in a xhtml page? I am generating my grid from a table: http://dhtmlx.com/docs/products/dhtmlxGrid/samples/12_initialization_loading/03_grid_int_from_html.html I ...

JavaScript border-color/color styling

Hi! I'd like to style 'input.submit' of a form (hover effect for IE) using JS and tried the following which doesn't work unfortunately. <!--[if IE]> <script type="text/javascript"> // CHANGE SUBMIT STYLE var foo = document.getElementByClass('input.submit'); foo.onmouseover = this.style.border-color='#000000'; this.style.color='#000000'...

Question about function returning array data

var grossBrackets = new Array( '300', '400', '500', '600', '700', '800', '900', '1000' ); function bracketSort( itemToSort ) { for( index = 0 ; index < grossBrackets.length ; index++ ) { if ( itemToSort < grossBrackets[index] ) { bracketData[index]++; } else if ( itemToSort > grossBracke...

DHTML with Javascript and CSS is not working

So for some reason this unobtrusive javascript code is not working and I can't figure out for the life of me why it won't work. I dynamically change the className of a div element and therefore I expect the CSS to reflect that change. However it doesn't. Here's the simplified code. html: <head> <title>Your Page</title> <link r...

javascript question - onclick

I am trying to get this code to work, but it keeps failing. try this link.. http://tinyurl.com/ye5khug enter Edmonton, click on icon, then on "web site". <script> function newPop(url, myWin, width, height, left, top, scrollbars) { parms = 'toolbar=yes, scrollbars=no, location=no, menubar=no, resizable=no, width= ' + width + ' , h...

any code snipt or plugin(jquery) for xml string(not xml file) parse ?

i want to manipulate xml data simple .. thanks ...

Free up memory in MobileSafari (iPhone/iPad) from cached images.

The iPad stops loading large images after about 8 or 9 images for me, since the page runs into its allocated memory limits. Since I'm showing these images one at a time, I'd like to remove the old ones from the browser cache so I don't hit the limit. Any ideas on how to do this in javascript? ...

What is the code behind this javascript?

Hi, I'm trying to find out how they were able to create this site. http://www.cpeople.ru, i am trying to build my portfolio to look something like it. Particularly, I want the slider effect of the menu. Please help me out. Thanks. :) ...

Does Facebook Connect have a javascript API that doesn't open a new window?

I want it to have a popup dialog javascript box. Instead of a new window. I've seen it before. How can I get it? Thanks. ...

Form submits correctly in Chrome/FF, but fails altogether in IE/Safari

I have a form with a css submit button. When a the submit button is clicked, i call a function that executes: document.forms["request"].onsubmit(); What should happen, then, is that the onsubmit method ought to be triggered. This works properly in Chrome/FF, but for some reason IE/Safari will bypass the onsubmit function and simpl...

Javascript: how to tell if a node object has been inserted into a document/another element yet

I'd like to be able to identify whether a given DOM node has been appended/inserted into another node yet, or whether it is fresh out of document.createElement() or similar and has not been placed anywhere. In most browsers just checking the parentNode works. if (!node.parentNode) { // this node is not part of a larger document } H...

any tools of create kml string for google-maps-v3.

i want to generate some kml string to stroe into database .. and has any simply way to generate this string ? thanks ...

N-son tabbed/JsScrollbar, trying to force gif play from click of link using jquery

Hello everyone, Let me start off by stating the obvious; I am new here. That said I hope I am not violating some standard I missed by posting this. xD For several days now I've been trying to update a rather old site of mine, to which I wont link to given that the update is so drastic that the current product on which I seek your help...

iframe accessing parent DOM?

How is it possible for a script within an <iframe> to have any notion of the page containing it? Can a script in the frame access any context outside of it? What about cross-domain? Up until now I believed an <iframe> is completely agnostic to the containing page, but I have seen an example which contradicts this belief. What exactly c...