javascript

Flattening a complex json object for mvc binding

My controller is returning an object graph to the view in json format like this return Json(customer); On the view my json object looks like this { Name: 'Joe', Budget: { Amount: 500, Spend: 100 } } Which maps correctly to my customer object: public class Customer { public string Name {get;set;} public Budget Budg...

is there any solution for calculation inches high of an advertisement inside HTML?

Hi , I'm developing an advertisement portal for a newspaper and I want to add an astonishing feature to my website. here is my idea : I want to add a capability to let user to write his own advertisement's text withing an area then let him to tailor it as the way he/she wants it then at the end , the program calculate the inches high o...

One problem to fix - jquery filter pagination

Hello everyone. I have 1 main problem I am trying to fix for my pagination script: Here is the current project I am working on so you can see the problem first hand. Also use the edit button at the top right corner to see all the code involved, or just view the source. Click Here PROBLEM 1: When filtering, it does not filter all pages...

Image manipulation with javascript

I need the best way to manipulate with image in web browser with javascript. How create script which will change brightness or contrast. I google a little but i can find any acceptable solution. ...

how to make a checkbox enable/disable based on selection in multiple box

I have a multi selection combo box and a checkbox in a form. I'd like the checkbox to be enabled only when user selects a particular value from the multi selection combo box. Is this possible to do ...either by javascript or jQuery. I am already using jquery elsewhere. Example: http://jsbin.com/ipomu to begin with checkbox will be...

[jquery] editableText plugin enabling problem

Hi, I've been experimenting with this plugin http://valums.com/edit-in-place/, so far so good... But i ran into this problem. I want to update my page when update or new request to save data is sent but if i update this function(edit-in-place) it will add second set of buttons, third, fourth and so on. How could i tell it that it would u...

Need to translate a jQuery animation to Dojo?

I would like to use a jQuery plugin called Superfish as the menu on my website. I'm currently using Dojo as my JavaScript framework. But, Dojo 1.4 supports some of jQuery's API (everything except animation, I think?). So I am able to run the whole plugin, except the "animation" part. My question is: How do I translate the jQuery $ul....

How to tell Facebook to remove Javascript cache.

So, i m working on a facebook app. It has javsacript. Of course, FB will sanitize the javascript. Of course, FB cache the javascript. Whenever I upload the js file, it takes a while or a long while for the new javascript to take affect. That's annoying for development. :( so, anyone know how to notify FB (vai API or some FB js call) ...

What is the simplest and best way to determine if the browser is IE or not?

(Don't care about the version. IE or not IE.) ...

jQuery, multiple inputs and onBlur

So I have 2 inputs. Both are for an "autocomplete". I also have 2 functions that do pretty much the same thing... Each input calls a different function onBlur. The problem is that the second upon selecting a "suggestion" for the second input, it populates the first. What can I do to make the second one populate the second? There's proba...

How do you manage a big script?

Hi, I'm building a JavaScript engine. I used a simple function as a class, added subfunctions, strings... and used prototypes to add other objects... Everything is fine. The problem now, is that I'm using one class (or main function), because I need it to be so. It's becoming huge, to the point that I can't control it any more and debu...

How to use TinyMCE custom button, with custom dialog, to add content?

TinyMCE editor lets you assign a custom button to it's editor toolbar. I did that and hooked it up to a Flickr account, so a custom dialog box appears with a selection of images. I want the user to be able to then click any image and have the URL of that image added to the original input, from where the custom TinyMCE button was clicke...

Pagination updating numbers

Hello, I am wondering if there is a possibility. I have a pagination script that grabs the content from a mysql database with php and using jquery to handle it all. I want to add a filter to the pagination which will get rid of some content based on the users selection. When the filter is set I would like the pagination numbers to upd...

Javascript find beginning of prototype chain

If I set a function to Object.prototype, and try to call the function from object Foo, is there a way for the function to know what object originally called it? Object.prototype.MyFunc = function () { console.log("I was called by " + (//object name here...)); } Foo = {}; Foo.MyFunc(); Thanks! ...

How to display an error if the content of a <textarea></textarea> is empty using javascript ?

I know how to display an error message if the user leaves a required input field blank when filling in a form, but I am not able to do the same with the textarea. ...

jQuery Load an external script rich PHP file into local page

Hi guys, I've searched the entire web for a clear answer but haven't found one yet. I have this site: www.helixagent.com/todo/ and I want to load that entire site into a portlet in my main index page. I tried an iFrame approach but it fails to load the site correctly. The styles and javascript files don't get loaded (i think) Is th...

Load and parse remote url with greasemonkey

How can I write a Greasemonkey script that will go through a list of URLs (on the same domain) and enable an XPath query to be performed on the resulting DOM? Thanks ...

Getting a random cell from a table in jQuery

Hello, I am trying to get a random cell in jquery, between 1-16, I have the random number code in Javascript. Now what I want to do is to use that random number, and make the pointer of the table go to that random number? How would this be accomplished. Here is my random number code. Math.floor(Math.random() * 16) <table id="bo...

Scaling a div with drop shadow on patterned background - solutions?

Howdy! I'm designing a page that has a Content Area which scales against a diagonally striped background. The Content Area div is a fixed width that will scale vertically with content. Because the border is a drop shadow, I have a repeating background image (40px wide by 80px high) that has to line up with the page background image. I ...

Can I reset the name of jQuery's global object?

Let me give my question some context. I have a JavaScript widget. The widget includes a copy of jQuery from my site. This widget is placed on a third-party site. The widget parses a JSON feed and injects the contents into the DOM. Pretty simple stuff. If the third-party page already has jQuery referenced and relies on jQuery plugins, c...