javascript

jQuery: How to stop AJAX function escaping JSON string used to POST data

I need to serialize all inputs from a form into a JSON string. With the help of this post, I can successfully create a valid string as below: {"input01":"value01","input02":"value02","input03":"value03"} However, when I try to use the string to POST data using jQuery's Ajax function, it seems to add backslashes to the string, resultin...

Javascript XmlHttpRequest Issues

Hello, I created a html/javascript website running on an Apache Webserver on Mac OS X. This website consumes a .NET Webservice with JSON via XmlHttpRequest. This Webservice is running on a Windows Vista machine. The website is accessible with this url: http://macintosh.companyname.local/~username/Sitename/index.html. When I open the we...

Slow javascript with IE8

I'm developing a grid with excel-like functionality using the telerik controls. For example users can click on a cell and the cell turns into an input control for editing. Users can tab to move onto the next cell or use arrow keys for up/down to get the cell above or below. I've found the standard telerik grid is good but I've had to ext...

Any ideas on how to embedded image on the rich text editor??

It is the demo application web site: http://www.freerichtexteditor.com/index.php?inc=demo/index The rich text editor can insert image on it, just like a word document, but the traditional web html form can't add an image on the html form. How this rich text editor work? why it can insert an actually image on the html form instead of p...

jQuery.load() - Inside External Javascript

Hi, i load an external page with $('#myContainer').load('myfile.html'); in myfile.html theres an <script type="text/javascript" src="otherscript.js"></script> Some users report that the otherscript.js is not loaded... i've tested a all common browsers (firefox, ie 6/7, safari, opera etc.) - i cant figure out why this wont work.....

Javscript: Acts different when test alert message is present

Hello, I have a text box function as below <input type="text" onkeypress="return onEnter(event,this);" onBlur="return chkForDBCS(this);"/> function chkForDBCS() check if a DBCS(mainly for japanese char) is entered in the text and throws an alert message and clears the text box. function onEnter() submits the form. When i have t...

safari: get the word under the mouse pointer

Hi, i'm trying to find a clicked word in an onclick event handler. somediv.onclick = function(event) { var w = getClickedWord(event); alert(w) } getClickedWord() uses range.moveToPoint for msie and event.rangeParent/offset for gecko, but Webkit seems to support neither. Any pointers? ...

Is it possible to subscribe to c# event with JavaScript?

Hello, I'm working on a web application that needs to frequently poll the server database and check for any available data to the client. Ideally, I would need to be able get a javascript function callback in the server, in order to be able to call the javascript function back whenever any new data is available on the database, instead...

Phone numbers Regular expression and Javascript

This is the regular expression I use to match phone numbers like: 00 00 00 00 00 00 00 0 00 00 00 00 +00 0 00 00 00 00 (\d{2}\s+\d{2}\s+\d{2}\s+\d{2}\s+\d{2})\s+(\d{2}\s+\d{2}\s+\d\s+\d{2}\s+\d{2}\s+\d{2}\s+\d{2})\s+(+\d{2}\s+\d\s+\d{2}\s+\d{2}\s+\d{2}\s+\d{2}) I have tried to include it into my javascript but It's not really working...

Can I use multiple versions of jQuery on the same page?

A project I'm working on requires the use of jQuery on customers' Web pages. Customers will insert a chunk of code that we'll supply which includes a few <script> elements that build a widget in a <script>-created <iframe>. If they aren't already using the latest version of jQuery, this will also include (most likely) a <script> for Goog...

Ext.Direct grid problem

(i posted this on the extjs forum too but recon SO is probably busier) HI I'm passing down the following json to a direct store: { "type": "rpc", "tid": 2, "action": "DirectReportDesigner", "method": "GetReports", "result": { "total": 1, "data": [{ "id": 1, "FullTypeName": null, "title": "test", ...

How to count the number of rows in a jqGrid?

How do I count the number of rows in a jqGrid? To clarify, there is not much data involved so the grid is pulling all of its data back from the server in a single query, instead of using pagination. ...

Javascript-disabled components not disabled after back button

Hi, I'm disabling groups of radio buttons when a user clicks a checkbox, just using raw javascript and the disabled property. My function is trivial: function toggleEnabled(elementId) { e = document.getElementById(elementId) e.disabled = !e.disabled; } and it is called with the onClick event like onClick="toggleEnabled('radio_di...

how to check for null and non-number data enterd(like characters or special char)in to text box by using java script?

hi i have a page having text box. in that i should not allow user to go to next page unless he enters some NUMBER. it should number but not text and should not be empty , any help pls? ...

Persisting client side data using JavaScript?

I want to persist some data between web requests using JavaScript. I would use Google Gears but I can't install Gears on each client machine or expect it to be installed. I found this SO Question but I don't like the idea of storing data in that method. Any suggestions will be welcomed. Thanks! Edit: Ideally I want to store "as muc...

Search Box Text - Show Hide Feature

On Chris Coyer's site he uses a nice little search box. I am curious to know how you get the text in the search box to disappear and reappear when you click out of the box. Thanks to a helpful person on this forum I use the following to have the text disappear when I click in the box: <input type="text" value="Search" onfocus="if (this...

Implementing a text slider or "slideshow" with AJAX or JQuery

I am trying to find a nice way to implement a text slider (examples: News feed or testimonials) with the AJAX control toolkit and/or JQuery that does the following: "Slide" (or fade) every few seconds to the next block of text The text blocks cannot be static, as there can be hundreds/thousands of them. Most likely will need to call a...

When to use $ and when not to

I have selected a control using the following variable var txt = $("#text1"); Now when I have to handle events on the textbox, do I have to reference it as $(txt) or txt will do $(txt).keydown(function() {}) or txt.keydown(function(){}) What is the advantage. Please explain it taking the variable txt as the context. ...

How to create a Flow chart? Javascript or Flash?

I want to create a simple graph as this screeshot : : the nodes must be clickablea nd they must have various forms. the arcs must have various colours and arrows! I found this javascript library :Raphael but I can't write into the nodes. Can anybody help me to find a library, javascript or flash, that create a sample graph as the scr...

redirect user after inactivity, but keep session alive

Hi, I try to redirect my page for a logged in user with a certain amount of inactivity to a different page without killing the session. I would like to substract the time I spent on the first page from the session, put the user on the new page, and then log the user out after his session (rest of the session time) times out and redirect...