javascript

Javascript error while executing alert function through php

Hi, I am using fusion maps in one of my application. In one of the example i have to pass the value from one map to another charts, I am facing one problem if the data passed is numeric its displaying alert message correctly but if it is a string it generates an error: NM is not defined javascript:alert(NM)() My code is as below: ...

Using JavaScript to "animate" my webpage

Hello, everyone! I thought I'd write a simple script to animate my webpage a little. The basic idea was to make a div grow bigger, when I push a button once and then shrink to it's original size, when I push it again. I handled the growing part well, but I can't get it to shrink again. I'm including a complete example, could you help m...

node selection and manipulation out of the dom (What is jQuery's trick ?)

Hi I would like to do dom selection and manipulation out of the dom. The goal is to build my widget out of the dom and to insert it in the dom only once it is ready. My issue is that getElementById is not supported on a document fragment. I also tried createElement and cloneNode, but it does not work either. I am trying to do that in ...

Change the whole content of site depending on monitor resolution

In my site I am applying a stylesheet depending upon the resolution of the viewer's monitor. By using screen.width in javascript i do this. But now I have a doubt that can I use the same technique to change the whole content of the site depending upon the resolution, i.e, for higher resolutions more contents and for lesser, fewer. Or you...

Jquery autocomplete not working from within a get ajax request

Hello, Im using the JQuery autocomplete plugin (http://docs.jquery.com/Plugins/Autocomplete) .I have an input field called by in my page.The following code works. <script> $(document).ready(function(){ somedata = "Core Selectors Attributes Traversing Manipulation CSS Events Exciting Electronic Effects Ajax Utilities".split(" ");...

How do I do ajax navigation on pageload ?

I have a page with several reports that are produced via ajax calls. I am prototype.js framework on this page for some of the display functions. The links for each report have anchors/tags like #Report1, #Report2 etc, which are hrefs with onClick functions that do lots of work to create the report via javascript. I would like to make i...

JSON best practices: filtering nodes client side or not?

In my database I store a number of "topics" and "examples". Each example belongs to one topic. I'd like show all the topics by name ASC in a tree component except for one topic (Topic C) which I always want on top. This may though come to change later and I'd rather not change the basic JSON output of topics and examples from the DB. 1...

ExtJS Change Event Listener failing to fire

I was asked to post this as a question on StackOverflow by http://twitter.com/jonathanjulian which was then retweeted by several other people. I already have an ugly solution, but am posting the original problem as requested. So here's the back story. We have a massive database application that uses ExtJS exclusively for the client side...

What is the easiest way to link radiobuttons to enable/disable other controls?

My webpage has a bunch of radiobuttons across a bunch of different radiobutton groups. Each radiobutton selection which is made will enable a directly corresponding element in the page and disable all other elements which correspond to the other radiobuttons in the group. What is the easiest way to make this link between the elements? ...

Javascript Multiple File Upload, Sequentially One at a Time

We have a form with five <input type="file"/> elements that is in production and working great. We get request timeouts and MaxRequestLength exceeded errors on occasion. To prevent these errors, I planned to write some Javascript to upload the files one-at-a-time instead of all at once. Here is how I planned on doing this... On docu...

What is the best to learn next to aply extra functionality to CMS templates

I've learned CSS and HTML, what should I learn next if my goal is to create templates for joomla and worpress? ajax? php? js? I poked around and haven't found a question that is alike so I posted this one thank you in advance! ...

JavaScript: clone a function

What is a fastest way to clone a function in JavaScript (with or without its properties)? Two options coming to mind are eval(func.toString()) and function() { return func.apply(..) }. But I am worried about performance of eval and wrapping will make stack worse and will probably degrade performance if applied a lot or applied to alread...

I find a solution for css detector

I have a html object element which is retrieved by document.getElementById() Is there any way to find out what styles are applied to this element? Not just class name set in CSS attribute. What I need is similar to the style inspect feature of FireBug (FF Addons). Is this possibly done with JavaScript? ...

Javascript not loading right when using updatepanel

Hello, I've encountered with an difficult bug, that Im not quite sure if there is a good way to solve it. But I have page(.aspx) which contains a control called widget. The widget appears multiple times in the page. And each widget has alot of js and jquery, some of them reads properties from the control. The problem I have is that the ...

Javascript + python url-en/decoding problem

Hi there im kinda stucked with the url encoding between python and javascript, i hope you can help me out :S Javascript: encodeURIComponent('lôl'); -> "l%C3%B4l" Python: import urllib test = container.REQUEST.form.get('test') print test print urllib.unquote(test) -> "lÃŽl" -> "lÃŽl" Javascript encodes "lôl" twice however python do...

Add class or ID to FCKeditor's editable iframe body

I'm using FCKeditor to edit the contents of a div. This content div has an ID set so my CSS can target the p, li, img, etc tags contained. I want the FCKeditor's contents to look the same as my div's contents. I have @import'd my stylesheet in the fck_editorarea.css, but of course the FCKeditor body does not have the ID set, so the style...

Is debugging complex HTML/CSS/JavaScript pages feasible?

Consider a complex rich internet application with lots of user interaction. I'm thinking of extensive drag-drop support, server-side user input validation, custom drawn UI controls such as an Outlook-like calendar, real-time UI feedback, etc... Would such an application be debuggable? I mean, can you easily step through the source code, ...

Converting a string formatted YYYYMMDDHHMMSS into a JavaScript Date object.

Hello, I have a string with a date in it formatted like so: YYYYMMDDHHMMSS. I was wondering how I would convert it into a JavaScript Date object with JavaScript. Thanks in advance! ...

Can you recommend a selectable Javascript Timetable widget?

Does anyone know of a js "time table" widget? I need the following: Days of week in columns & hours of day in rows 1 hour time slot cells (or customisable) Ability to select multiple times during the week using mouse to highlight/select cells. Select times across days of week (e.g. highlight 6pm time slots Monday to Friday with the...

How to check if property 'isElementContentWhitespace' is supported?

I want to use isElementContentWhitespace on text nodes, but not all browsers support it, so I need to check if its supported, then if is, use it, if not implement jquery's $.trim... i've tried doing something like this with no luck on IE, good on FF: var testEl = document.createElement('span'); testEl.innerHTML = ' '; alert( testE...