javascript

Javascript: What is the recommended way to pass urls as url parameters ?

Using '&url='+encodeURIComponent(url); to pass a URL from browser to server will encode the url but when it is decoded at the server, the parameters of url are interpreted as seperate parameters and not as part of the single url parameter. What is the recommended way to pass urls as url parameters ? ...

IE7.js vs Whatever:hover.htc vs Son of suckerfish.js ?

If I'm already using Dean Edwards's IE7.js for IE6 then do i need to use Whatever:Hover htc and javascript(which we use only for IE6 hover) for Son of Suckerfish menu ...

bug when prototype and jQuery are both loaded

I have function in Javascript which works fine using prototype. The function is used to dynamicaly change a select field based on the selection of another field. var sizes_286 = new Array(); sizes_286.push(new Array(536, 'Pequeno', 1661)); sizes_286.push(new Array(536, 'Médio', 1662)); sizes_286.push(new Array(536, 'Grande', 16...

jquery object inside an object literal

i am trying not to repeat the selector and get to its children via a the same objects parentElment declared variable. I tried: testimonialsBelt={ parentElment:$(".testimonialsCntnr ul"), childrenElem:this.parentElment.children().length } I also tried: testimonialsBelt={ parentElment:$(".testimonialsCntnr ul"), childrenElem:$("te...

Javascript or XUL windows WITHOUT iframe

Hello everyone, I am trying to build a multi-window website for my bookmarks, but I have some problems. Here is the js version of what I am trying to build: http://www.students.itu.edu.tr/~ozyildiri2/zpwin/zapatec Unfortunately, there are problems with this approach. The sites in the windows are loaded through iframes, and iframes hav...

Easiest way to execute local file from Firefox?

I am developing a web application. I would like to extend my error messages (and their backtraces) so that I can click on the mentioned file, and have it opened automatically in my PHP IDE. I would like to make this a easy-to-activate feature so that whoever works on the web application, can easily map the error message to point to thei...

JQuery Slide Event and Div Height not changing as expected

I am working with JQuery and I'm trying to change the html of a div box when the child div slides in and out. My problem is that the code below isn't changing the html value of #menu_text. It only displays Hide Menu and is not detecting the real height as changed by slideToggle. $('#menu').click(function () { $('#menu_links').slideTo...

Keypress in jQuery: Press TAB inside TEXTAREA (when editing an existing text)

I want to insert TAB characters inside a TEXTAREA, like this: <textarea>{KEYPRESS-INSERTS-TAB-HERE}Hello World</textarea> I can insert before/after the existing TEXTAREA text - and I can insert / replace all text in the TEXTAREA - but have not yet been able to insert inside the existing TEXTAREA text (by the cursor) in a simple way. ...

Auto-generated Form Value

Looking for guidance on how to achieve something in ASP.NET Web Form - the behaviour is a bit like that seen in ASP.NET AutocompleteExtender, but I can't find anything that gives the flexibility I need. Here is what I am trying to do: 2 TextBox fields on the form, CompanyName and CompanyRef (CompanyRef an abbreviated unique Company ide...

some php help in making an 'approve form' page...

I have a main form with a lot of inputs. The forms action is set to a php file. After submitted the php-page shows up with all the inputs that the user typed into the form. The user has to re-check everything and hit an 'approve' button! The problem is, I don't know how to do this... I want to eventually put all data into a MySQL databa...

Theming for/with javascript?

A colleague made a small module to retrieve twitter search results based on user configurable search terms and display them in a block. He is doing the searching with javascript to keep that traffic on the client side, something like: $.getJSON('http://search.twitter.com' etc.. Then when the json results are returned inserting them int...

What is a good Javascript debugging tool?

Haven't touch javascript for 3 years. Just got a javascript project and wanted to know any new ways or tools emerged these years to debug javascript? I used alert 3 years ago. I am using IE ...

Javascript/AJAX element-shown event

In javascript is it possible to trigger an action when a element (for example a div) is shown in the screen? I have an "endless" grid that extends both horizontally and vertically, and I would like to load the elements dynamically using AJAX while the user scrolls. Thanks ...

Merge/Join 2 jQuery sets

Look at this code for example $div = $('#my div'); $ul = $('#somewhere ul'); How can I perform a jQuery method on both of them? For example, would this work? What is best practice here? $($div, $ul).addClass('my-new-class'); Wouldn't that search $div under a context of $ul ? Thank you ...

Problems unit testing setInterval function in Javascript

Hi all: I am having difficulties testing window.setInterval function in my Javascript file. Below is the scenario... basically I have a setInterval function in a function which I want to test: var dummy = false; // global variable not set anywhere else var INTERVAL_TIME = 20; // global variable not set anywhere else function myFunctio...

Can I interact with .NET libraries through Javascript?

We've built a set of .NET libraries (in C#) which are used to interact with an outside resource. The outside resource provide bindings in Java and .NET, so it was necessary to build our libraries in one of those languages and we're officially a Windows shop. We also use PHP/Javascript for a lot of our front-end web applications. Is it p...

Preserving SCRIPT tags (and more) in CKEditor

Update: I'm thinking the solution to this problem is in CKEDITOR.config.protectedSource(), but my regular-expression experience is proving to be too juvenile to handle this issue. How would I go about exempting all tags that contain the 'preserved' class from being touched by CKEditor? Is it possible to create a block of code within t...

Which are case sensitive among php/javascript/html?

I'm new to these languages. ...

Open another FancyBox from callbackOnShow

I am using this http://fancybox.net/ I have 2 DIVs: 1st open and 2nd hidden In the first FancyBox, I want to run several things in callbackOnShow and then once done, it closes and opens the second hidden Fancybox. However I used $('a#div-2').trigger('click'); and it is not working. It seems that the FancyBox trigger won't allow within ...

Validating user input with JavaScript

I need to make it so a user can ONLY type a-z0-9 into my input box. How can I make it so the user simply cannot type other characters? If this isn't possible, how can I simply check the input with regex? Thanks! ...