javascript

Browser is not smooth while using jQuery "replaceWith"

Hi everyone, I'm using jQuery replaceWith to update information of my website. Div elements which are returned are small. The function is called after 5 minutes. When I focus on browser, replaceWith function will run but my browser is not smooth and sometime can crash. Which plugin or solution can I use to resolve the problem ? I used: $...

how to clear a object from memory using javascript .

this is the demo code : function a(){ this.a='aaa' } var aa=new a how to clear the aa object from the memory thanks ...

How to use variables in SQL Lite transaction (web kit browser local database)?

So I have an array with variables with values from textfields var data = [name, address, city, country]; then the command transaction.executeSql("INSERT INTO Customer(name, address, city, country) VALUES (?, ?, ?, ?)", [data[0], data[1], data[2], data[3]]); It works fine but in the real database I have about 50 fields and if I nee...

Object Oriented Javascript vs. Pure jQuery and .data storage

My current style of programming is OO javascript using the Class.extend function by John Resig: http://ejohn.org/blog/simple-javascript-inheritance/ This has been fine but I find myself writing numerous setters and getters that only get used on init. Also, it seems to lead to memory leaks in IE when storing instances of these objects i...

Redefine a method on an object

I'm trying to do the following: //Code under test function Foo() { this.do_something_interesting = function() { var dependency = new CanYouMockMe(); if(dependency.i_want_stubbed() === true) { //do stuff based on condition } else { //do stuff if false } } } //Test Code describe("Foo", function () { it("...

jQuery $.post with passed variables fails

I am wondering why: $.post("remote.php", {'f':a_searchtype, 'partial':value}, function(data){ $("#result").html(data); }); worksfine. but using a variable such as: ajax_arg = {'f':a_searchtype, 'partial':value}; $.post("remote.php", ajax_arg, function(data){ $("#result").html(data); }); causes javas...

advanced rollover to display extra options

Hi, I have a web app that has a list of user comments. I want extra options for these comments (vote, reply, etc..) to appear only when the comment itself is mouseover-ed The best example of what I am looking for would be a youtube video: http://www.youtube.com/watch?v=s2VzLn6DMCE&ob=av3e When you go to the comments the options...

jquery recognize if li is clicked or p inside the li is clicked

<ul id='myid'> <li id='1'> my text 1 <p id='1' >inside p1 clicked</p></li> <li id='2'> my text 2 <p id='1' >inside p2 clicked</p></li> <li id='3'> my text 3 <p id='1' >inside p3 clicked</p></li> <li id='4'> my text 4 <p id='1' >inside p4 clicked</p></li> <li id='5'> my text 5 <p id='1' >inside p5 clicked</p></li> </ul> ...

JavaScript: Use Object As Array

Are there any pitfalls to code like this? var Foo = function() { this.bar = function() { return 'bar'; }; }; var f = new Foo(); f[0] = 'hi'; f[1] = 'there'; Note that I'm creating a new function object with some misc properties, and then I'm treating the object like an array. Also how are the array values being stored in the obje...

NyroModal not showing dynamic links for Next and Prev images

I am using nyroModal to display a lightbox when an image in thumbnail gallery is clicked on. The thumbnail gallery is created from AJAX which sets each thumbnail to link to a javascript function passing 3 URLs. One for the large version or the image, one for the next image in the gallery and one for the previous image. This is the jav...

Optimal language to develop with Unity?

Hello everyone. I would like to ask you all about the Unity framework and programming. Unity supports three different languages; Boo, C# and JavaScript. Say you were new to programming and developing on OS X. What is the best language to learn and use alongside Unity to create games? ...

TouchCancel when swiping over UIControls native Tabbar

Hi guys, I've developed a jQTouch app ( http://bit.ly/9uE1i0 ), with iScroll integration ( http://bit.ly/9KsKz3 ), using the native tabbar ( http://bit.ly/ag3H6b ). All works great in PhoneGap except that iScroll sticks when the swipe motion goes over the uicontrols tabbar. See video: http://screenr.com/AcD Is there a way to inc...

jquery not working with chrome

I am using following jquery method $('form').submit(function(){ $('#universities_selected option').each(function(i) { $(this).attr("selected", "selected"); }); }); when we submit form this method is called and it checks all the entries in multi select list "universities_selected" and set them as selected.......

How does the new Apple page fade in the image?

Apple changed their home page with a fade in effect that loads fast. Is this HTML 5 or jQuery? Does anyone know how they did this? ...

Can you call C# function from javascript?

Possible Duplicate: Call ASP.NET Function From Javascript? this question is asked by interviewer. can anybody tell me that is it possible? if yes then how. ...

how to customize the basic infowindow with tabs displayed using GInfoWindowTab on google map

I have the following function to display the infowindow with tabs on google map using GInfoWindowTab ,the default infowindow is displayed with two tabs ,my question is how can i change the size ,background color and styles of the infowindow and can i add videos into one of the tab in infowindow. function createMarker(point, name, addre...

How to load all scripts, stylesheets, and markup from one js file?

The following small snippet of code cannot be changed once deployed (it's in an RIA) so everything must be loaded via a bootstrapper.js file: <div id="someDivID"></div> <script type="text/javascript" src="bootstrapper.js"></script> What's the best way to load up all the js, css, and markup? Is there a better (cleaner, faster, crisper...

What are some recommended server-side javascript implementations?

Background: We've written some client-side javascript that we now have to move to a server for performance reasons. What we'd like to do is move the current javascript right over to a server rather than re-writing in a different language. It will need to access an Oracle database to get data. Question: So, what are some recommended i...

Sizes calculation with JavaScript and jQuery

Sometimes i'm facing problems, trying to get sizes of an HTML element in question. I'm tracing JavaScript code and see, that width and height of this element are returned as 0. When i do the same piece of code in browser's console, correct sizes are returned. Example code, that demonstrates this problem is following: <!DOCTYPE html> ...

Google Chrome Folder Drag and Drop Support

in Google Chrome 7 Folder drag and drop has been added click-here, Can any one show demo code how is that possible? ...