javascript

Prototype find class and replace text

Hi Guys, I am using the prototype framework [requirement by platform] and I am trying to find a ID and replace some text in the ID so that it disappears. The HTML looks like: <div id="top"> <a href="/login">login</a> | <a href="/register">register</a> </div> The problem is I don't want the " | " to appear in the ID "top". So I guess...

How do I get started with NodeJS

Is there any good resources to get started with Node.JS? Any good tutorial, blog or books? Of course, I have visited http://nodejs.org/, but I didn't think the documentation they have is a good starting point. Thanks ...

javascript string replace equivalent on php?

I am trying to prevent xss injection. So before I submit a form, a javascript function is called function validatefield(id) { var description = document.getElementById(id).value; description = description.replace(/[\"\'][\s]*javascript:(.*)[\"\']/gi, ""); description = description.replace(/script(.*)/gi, ""); desc...

Dynamically generate the content of Drop Down list via jQuery

I am new to Javascript, JSON and jQuery. So please be easy on me. I have a JSP page that contain a drop down list. The contents of the drop down list are populated when the page is loaded. I wrote a Servlet that return the contain of the drop down list in the form of Map, and convert it to JSON string and sent back to the jsp via respons...

Find and Replace Text with Prototype

I am new to Prototype and was wondering how to simply "find" some text in a class/ID and "replace" this text. My html is like this: <div id="test"> <a href="/test">test</a> <a href="/test2">test2</a> <a href="/test3">test3</a> <a href="/test4">test4</a> </div> And I am trying to replace the "test" in between the <a> tags for ...

Problem with a button's OnClientClick event inside an UpdatePanel

im using javascript like var TargetBaseControl = null; window.onload = function() { try { //get target base control. TargetBaseControl = document.getElementById('<%= this.GridView1.ClientID %>'); } catch(err) { TargetBaseControl = null; } } function TestCheckBox() { if(Target...

How to disable browser context menu on Ext.menu.Menu's items?

Assume I have a menu (Ext.menu.Menu) with some items. When menu is shown user cat right-click on it's item and browser context menu will be shown (with elements like "Save link as..."). How can I disable that browser context menu? Globally in all Ext.menuMenu instances if possible. ...

Is there a UI builder for Ext Js?

Any good UI builder for Ext Js out there? ...

Echo php into google map javascript

Is it possible (and if so please explain how) to echo php into javascript, specifically for my purpose I am trying to echo the input of a custom field from the wordpress platform into the description of a google map. I am hoping I can give the client a cms backend to input the text that appears in the marker points on a map. What I am ...

How to set popup position?

I work on Asp.Net vs08 C# .I want to show popup ** Bottom** of the button .Not on center of page.Here is my syntax . Aspx code: <input id="Button3" type="button" value="Open 1" /> Jquery: <script type="text/javascript"> $(function() { $("#Popup").dialog({ bgiframe: true, autoOpen: false, height:...

Testing jQuery change event using Watij

I have a select list where a change event has been bound to the element using jQuery. Something like this: $("#someId").change(function() {..}); When someone chooses a new option in the select list, another part of the UI will change accordingly. Now this works fine when I use the mouse and click things, however, when using Watij to...

My JavaScript seems to crash when I instantiate a new Date Object

I am new to JavaScript with this being my first little app. I am working on this Calendar / Date Time Picker program. I seem to have entered a nightmare scenario where the app crashes and I cannot figure out what is doing the crashing. After some primitive sleuthing (ie successive document.writes to pinpoint the line which kills it, I se...

Columns of Equal Height with JQuery

Hello, Can we put JQuery to use to create columns of equal height? If yes, how? Thanks ...

Convert lowercase letter to upper case in javascript

Hi , I have a code that will convert lower case letters to uppercase but it works only with IE and not in Crome or Firefox. function ChangeToUpper() { key = window.event.which || window.event.keyCode; if ((key > 0x60) && (key < 0x7B)) window.event.keyCode = key-0x20; } <asp:TextBox ID...

In BB OS4.5, The tag <a> didn't support "click" event?

Hi All In BlackBerry,I used the javascript as following to automatically trigger click event click document.getElementById("test").click(); it Can't work in BB OS 4.5 Browser, if i click it manually, it can work. Can somebody help me? ...

how this function work and how i can pass paramater that is param_url

below is function i want to use (function () { var url = param_url; })(); // what these ending curly brackets do ? ...

Jquery if statements, selectors

HI all, I am just starting to use jquery, I need to do something that I am not sure is possible. I know to use if statements on jquery is like normal javascript but I dont know how to use the jquery selectors on a normal if statement. The function its currently working, but I am having two problems which I don't know how to fix, (I wou...

get value from javascript object

when alerting a variable in javascript it shows like this.. totally 9 values(name, address, city, friend etc) how to retrive the values [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] ...

Iphone darkens div on click

When you have a div with a click handler attached, the iphone darkens the div as a click indicator, when the div is clicked. Example: view on mobile safari http://jsbin.com/awejo3/4 My question is, how do I turn this behavior off? This is probably useful for most iphone users, but in some types of rich media applications, this is bad. ...

How can I stop elements overlapping using JavaScript and the Raphael JavaScript library

Hi there, I’m generating multiple, random sized, circular elements using the Raphael JavaScript library but because it’s random a lot of the circular elements being generate overlap or cover each other. What I wanted to know, is there any way with JavaScript to tell if one element is in already in particular position so to avoid the ove...