javascript

jquery plugin manipulation

I have a jquery plugin that looks like this, $.fn.customSelect = function() { // define defaults and override with options, if available // by extending the default settings, we don't modify the argument return this.each(function(i) { obj = $(this); obj.after("<div class=\"selectoptions_"+i+"\"> </div>"); obj.find('option').e...

Retrieving the text of a specified link tag not working

Hi guys, so I have a few links that have a class of 'button', and I am trying to get their text values with the jQuery .text() function, but it is returning nothing at the moment, code: $(document).ready(function() { var tester = $('a.test').text(); alert(tester); }); HTML: <a class='test'>TEST</a> any idea why this might not ...

How to fetch textbox array value using javascript/jquery

I have an array of text inputs like this: <input type="textbox" name="mobileno[]"><br> <input type="textbox" name="mobileno[]"><br> <input type="textbox" name="mobileno[]"><br> They are generated at run time using an "add more" button. Is there a way I can use jQuery to fetch the text input value and pass it in ajax request? I have...

Telerik. RadScriptManager issue at RadWindow.

Hello, i show RadWindow from parent form: <telerik:RadTreeView ID="tvFile" runat="server"> OnClientContextMenuItemClicking="onClientContextMenuItemClicking"> <ContextMenus> <telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server"> <Items> <telerik:RadMenuItem Value="Rights" Text="Rights"/> ...

paste_preprocess tinymce issue

i want to strip all the html tags when pasting in tinymce editor. following is the code which is not functional... following is the tinymce settings... the paste_preprocess callback is not trigering... am i missing some option..? tinyMCESettings = [ { mode : "none,textareas", height:heightEditor, width:'100%', ...

JavaScript loop performance - Why is to decrement the iterator toward 0 faster than incrementing

In his book Even Faster Web Sites Steve Sounders writes that a simple way to improve the performance of a loop is to decrement the iterator toward 0 rather than incrementing toward the total length (actually the chapter was written by Nicholas C. Zakas). This change can result in savings of up to 50% off the original execution time, depe...

Really simple document.onmouseup not working with IE

Hey, I have another incredibly simple JavaScript problem... I have a div that is shown when a link is clicked on. That is no problem and working fine. I then need the div to be hidden when the mouse is clicked anywhere on the page. Again, no problem in FF,Chrome,Safari and Opera but not in IE and it is really doing my head in now(!) Her...

when is window.onload fired

Hello, I'm a bit confused as to when the window.onload event is fired. For example: i have a page that has lots of external js files and even an on-demand loading of the script (dynamically creating a tag). All of this code is in the page (ie. it does not get fired on click or smth, it should execute while loading). Now let's say that i...

trapping and logging "bugfoot" javascript exceptions in a meaningful way

We have had some reports of problems with our checkout whereby customers get js exceptions (we assume) so they cannot checkout. No matter how many testbenches we use, we have failed to recreate the issues but that's the point of the exercise. I have setup a simple error trapping function which works based around: window.onerror = fun...

Using ternary in JavaScript

Is there a shorter way to write this? var ttt = "dd"; if (ttt.length < 3) ttt= "i" + ttt; ...

How to use this code as Unobtrusively?

How to use this code as Unobtrusively? To keep content and Behaviour separate. <a href="nojavascript.html" onclick="functionName(); return false;" onkeypress="functionName(); return false;">Link text</a> ...

Javascript object serialisation with toSource() converts special chars to hex code - how to reverse?

If I'm converting a simple JavaScript object to a string, all special chars will be converted to hex code. function O() { this.name = "<üäö!"; } var myObject = new O(); console.log(myObject.toSource()); Result: {name:"<\xFC\xE4\xF6!"} How would I avoid this or convert all hex chars back to utf8 chars? ...

IE7 - Styling Javascript generated Element

Hello there, It's seems very curious but I'm having problems applying styles for javascript generated elements in IE7 but if I render the same element as string it does work. on my javascript: var style = document.createElement('link'); style.setAttribute('type','text/css'); style.setAttribute('rel', 'stylesheet'); style.se...

iframe content from javascript

hi everybody! i need to get iframe content in javascript or jquery, but main problem is that iframe src is other domain web site, how can i do it? ...

cross domain iframe adjust height automatically

I searched over google as well as few answers from stackoverflow but none of teh solution worked for me. Is there any working solution available , Thanks you very much Rohit. ...

jquery: get parent element from ajax call

How to make this code work? I don't see how i can reach div from within $.get callback. $("<div/>", { text: "some text", click: function (e) { $.get("bar.php", function(data) { $(this).text(data); // doesn't work }); } }).appendTo("body"); ...

How to show image thumb from input type file without upload, or with

How to show image thumb from input type file without upload, or with I need to create file preview, when user select file in input type=file, i found, that ajax don't support file upload, so - maybe it is possible to show thumbs _without_actual_upload_ in js? Jquery/simple js ...

How to add parameter to multiple rendered URLs?

Hi, I've got a PHP page serving content into an Iframe on another website, and it needs to re-load content inside the Iframe according to user interaction on the host website. The page content that's inside the Iframe contains multiple URLs. In order for the Iframe interaction to work, I was thinking of using a request parameter in the...

How do I position a div next to a mouse click using JQuery?

Hi All, How do I position a div next to a mouse click using JQuery? Thanks ...

unable to set dynamic data in jquery fullcalendar through ajax

can somebody tell me how to populate "jquery fullcalendar" events using ajax. There is no setter method provided in fullcalendar to set ajax response (which is Json object) after calendar object loads. Is there any way to feed data after calendar object loads? In my case very first time I provide data in fullcalendar "event:" property ...