javascript

Run sifr without page refresh?

is it possible to make sifr re-run or update again without having to refreshing the page?? Id imagine there is a function like sifr() or something..? ...

Remove All Images

What JavaScript will remove all image tags? ...

JQuery/JavaScript performance using $(this)

I find myself doing a lot of this kind of JQuery: $('.filter-topic-id').each(function () { var me = $(this); if (me.text() == topics[k]) { me.parent().show(); } }); I store $(this) in a variable called me because I'm afraid it will re-evaluate $(this) for no reason. Are the major JavaScript engines smart enough to ...

JSObject-like stuff in ActionScript 3?

I would like to ask if there is a liveconnect equivalent for ActionScript 3. I understand that there is the ExternalInterface class inside AS3 but it only supports calling a method by name. The really cool thing about Java and LiveConnect is that you can do something like function jsFunc(name) = { this.name = name; this.talk = funct...

How to override private variable in javascript?

// base function function Man(name) { // private property var lover = "simron"; // public property this.wife = "rocy"; // privileged method this.getLover = function(){return lover}; // public method Man.prototype.getWife = function(){return this.wife;}; } // child function function Indian(){ var lover = "jothika"; t...

getting javascript 'Sys' is undefined error

On the developement machine my website is working fine but I am getting javascript 'Sys' is undefined error on hosting server and my AJAX is not working. I have make a sample page and scriptmanager on it, Please look into this. http://nexapps.com/default2.aspx button and textbox is in AJAX updatepanel, but when hit to button page is fu...

How to pass data from javascript to c# (asp.net mvc)

how i return a value from javascript function to a c# variable (in controller) and also i have a multicolum dropdown box in a form , eg book details , when the user makes the selection the book name is set in the dropdown , but when submit is hit i want the code book to be returned(this value is returned by my javascript) for billing p...

java script for a drop down selected index change

hi, i 2 Dropdown controls and 1 text box In drop down1 one i have the values like 11.00,11.30,12.00,12.30,13.00, 13.30 In drop down2 one i have the values like 11.30,12.00,12.30,13.00, 13.30, 14.00 once the user selects the values in drop down 1 and drop down 2 an event will fires in drop down 2. where the sel...

Hiding privates from Javascript Intellisense

Is it possible to hide certain functions/fields from displaying in javascript intellisense drop down list in Visual Studio 2008? Either by javascript documentaion XML of by naming privates in a certain way? I've seen <private /> in jquery vsdoc file that implies exactly this behaviour, but doesn't meet my expectations { __hiddenFie...

JSON parse -> stringify -> parse broken?

Hi, I'm using json2.js for this: var str = '{"elements":[{"text": "", "colour": "#66AA50", "type": "line"}]}'; var obj = JSON.parse(str); var str2 = JSON.stringify(obj); var obj2 = JSON.parse(str2); Weird thing is that obj2 is a broken version of obj, i.e it's not identical to it. In ...

Combined image rotation & cropping in jQuery

We currently have a system for cropping images that uses jCrop on the front-end, and System.Drawing in .NET on the backend - this works very well, but now we need to introduce image rotation. Only 90 degree angles are needed, and jQuery.Rotate works fine in isolation, but I would like to combine these two jQuery plugins gracefully. Do yo...

ASP.NET: JavaScript modifying the value of a HiddenField before submitting

I have looked at similar questions on Stack Overflow but haven't been able to find the solution to this particular problem. I have a simple (not really, but let's pretend) ASP.NET page with an update panel inside it. In this update panel there is a HiddenField control with a value that will be set/updated via my own custom JavaScript. T...

Thank you alert upon form submission

I have a very basic form at http://www.happyholidaylites.com/contact.html and it is working great. When you submit the form, the user is brought to the index.html with no message that the form has been sent. I am looking to initiate an alert that says, "your form has been submitted" with an x button. My code looks like this: <fo...

Set an object in a page's window object from a Firefox extension?

I want my Firefox extension to add an object to the content window of the browsed page. I want it to have the same effect as running: top.myobj = {val : 3}; inside a script element in the page. Any ideas? I don't think there is a security risk here as I only add an object with a single integer property. Is there a simple way to get ...

jQuery: Why use document.ready if external JS at bottom of page?

I am including all of my JS as external files that are loaded at the very bottom of the page. Within these files, I have several methods defined like so, which I call from the ready event: var SomeNamepsace = {}; SomeNamepsace.firstMethod = function () { // do something }; SomeNamepsace.secondMethod = function () { // do somet...

How can I convert this working JS code to JQUERY

var xmlHttp; function RefreshORP(eventTarget, eventArgument) { xmlHttp = GetXmlHttpObject(); if(xmlHttp == null) { return true; } xmlHttp.onreadystatechange = StateChanged; var params = GetFormParam(eventTarget,eventArgument); xmlHttp.open("POST","/contact.jsp",true); xmlHttp.setRequestHeader("Content-type", "a...

Dynamic Forms in Spring

I am trying to make a dynamic form using Spring forms. Basically, the form gets a title of learning activity and then there's the a button below it that says, "Add one more Learning Activity". This makes it possible for the user to add one more learning activity. I want him to be able to add as much as he likes. I haven't tried this be...

stop double postback

Here is what I am doing. I create two buttons in a header row of a gridview that i created. The buttons are +page and -page. When -page is hit I remove the paging and all the data goes down the page and -page disappears and +page is there. Here comes my issue When I hit +page I must be double postbacking because one row of my data disap...

Access cookies from Google Chrome extension

Is there any way to access cookies from Chrome extension? this code document.cookie.length always returns - 0. ...

Loop through form fields with JQuery using .submit() event handler.

Hi all. I'm having a little problem with form submission with jquery. I've submitted a lot of forms with it in the past but I was just thinking, how can I use the event handler .submit() to submit a form and it's elements without callin the forms ID. The problem is that I can't seem to be able to chain elements with $(this) (it's possib...