javascript

Splitting a string in JavaScript by multiple delimeters

I want to split a string : OU(EGAL([Zone_libre_utilisateur],"0000"),ET([Code_courrier],"ABO")) using delimeter , & ( in javascript. How can it be done? ...

how do i show a jqueryUI at a dynamic location

I want to show a jquery dialog next to a button when its clicked. i have: <input type="button" name="test" value="i" onclick="$('<div></div>').html('test message').dialog( {title: 'Test Dialog',modal: false, width: 200, height:140, resizable:false});" /> i dont think I can make a function call within a json definition? I can get t...

How to remove the "Be the first of your friends to like this" part of the standard iframe Facebook Like button?

I'm using the standard Facebook Like button (iframe, not fbml). Is there a way to only display the like button, not the 'Be the first of your friends to like this' part? ...

ASP.NET catch referenced script file exceptions

How to catch exceptions raised by a referenced javascript file in an aspx page?? ...

What is SproutCore and why should I care?

I have just seen the news that a person has left Apple to develop SproutCore. It seems to yet another collection of jscript code. So what is the big deal and way are a lot of people making song and dance about it? What does it provide that jquery / extJs / etc does not provide? How does anyone decide if it is worth investing the time...

Get response from server with Javascript after Javascript request

Hi, My Javascript function request to a aspx page. İts Code : var xhr = ("XMLHttpRequest" in window) ? new XMLHttpRequest() : new ActiveXObject("Msxml3.XMLHTTP"); xhr.open("GET", = 'http://www.example.net/abc.aspx', true); xhr.send(""); After this Request I want to send a response back from this page and catch in client side...

How to discover if an Ext.FormPanel is changed

Hi, i've some Ext.FormPanel and i want to enable the "Save" button only when the user changes the values inside the form. How can i discover that the user changed some fields ? I've tried with form.on("change"), SelectionMode but without any success. Thanks ...

what is the use of setting setTimeout to a variable and is there a need for clearTimeout

i was wondering what was the use of setting setTimeout to a variable scroll_timer = window.setTimeout(function () { ... when i can just use window.setTimeout(function () { ... and is there a need to clearTimeout actually? line 2 $window.scroll(function () { window.clearTimeout(scroll_timer); scroll_timer = window.setTim...

Javascript: Add Break after each 100 characters

If I write to long text for example this: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa The text is going out of the page, I have an idea to fix it, after every 100 characters I could make a <br /> tag. But I don't know how to do it. Thanks for any help! ...

Which is the best way of correct filter for HTML editor in PHP?

I'm using TinyMCE editor in my site. I want to learn way of correct filter for my input when i'm inserting to DB. Which filters are need to use? For example i get this input to DB this way; $example = $_POST['example']; <textarea name="example"></textarea> I'm not using htmlscepialchars(); because i need the html tags. "Sorry for my...

add using jquery

Hello, I want to do this var x=$(this).attr('id'); var y = x+1; where x is an integer but the value I get is x1 How do I do get the 16, if x=15? Thanks Jean ...

Safe JavaScript Templates

I am looking to allow users to create templates to display their data, and these templates are to be rendered using JavaScript. I was wondering if it was possible to safely do this? I just need simple things like loops and if-else statements and of course accessing and printing values of variables in a given object. Are there any templa...

Force stop map dragging

Hello ! I am working with Google Maps right now and I want to be able to disallow user dragging map out of specified boundaries. var strictBounds = new google.maps.LatLngBounds( new google.maps.LatLng(49.00, 14.07), new google.maps.LatLng(54.50, 24.09) ); What should I do ? I tried to use drag event but with no luck.. google...

Collecting votes across multiple sites

I am looking for a solution that allows people to submit their vote to the main site via a voting system or banner. At the moment, I am aware of one solution that works with drigg and drupal, but it requires url redirect or mod_rewite that is not currently available on the clients server. Is anyone aware of a solution that would allow...

how to use variables in tinyMCE.init tiny mce ?

Can we use variables in tinyMCE.init() ? I want to decide the available set of buttons on value of formatselect. Is this possible ? ...

ExtJS: How to dynamically add child nodes to treepanel

How can you add a child node to an existing TreePanel programmatically using JavaScript? I have a TreePanel that displays the active layers of a map (using GeoExt): treeConfig = new OpenLayers.Format.JSON().write([{ nodeType: "gx_baselayercontainer", text: "Base layers", expanded: true }, { nodeType: "gx_overlaylaye...

CKEDITOR ajax posts

I have looked far and wide, and I cannot find any answers. I am trying to make an admin page using ajax so when the client updates information in the CKEDITOR it doesn't have to take him to a new page. Getting data from input fields are easy enough using the .val() function, but because textareas are not updated on the fly, I can't use t...

Difference between quoted and un-quoted JavaScript object properties

Is there a difference between quoted and un-quoted JavaScript object property/method names? For example, what is the difference between these two: var obj1 = { property1 : "Value 1", method1 : function() { return true; } }; var obj2 = { "property1" : "Value 1", "method1" : function() { return true; } }; ...

How to make google maps API get the restaurants in the specified area

Hi, So far I use http://maps.google.com/maps/geo?q=downtown&amp;output=csv&amp;key=whateverthekeyis to get the longitude and lattitude of some address. function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById('"mapHolderID'); map.addControl(new GSmallMapControl()); map....

How to replace iframe to div ?

Hi actually i am working on ajax in which i want to convert the iframe into div means that what is the functionality of iframe i want the same in div Thanks. ...