javascript

How to delete extra DIV element from HTML Document

I am developing a News application and for this i am using a web product for fetching News Headline. When I call a NewsHeadline, product sends a Html Code including News Headline. <div class="mydiv"> <script type="text/javascript"> document.write('&lt;div style="display: none"&gt;'); </script><div style="display: none;"> <div>< a h...

how to detect a function was called with javascript

i have a javascript function how to check if function was called ( in <head></head> section have this function ) then not call function if function was not called ( in <head></head> section haven't this function ) then call function like require_once or include_once with php help me thank ...

how to make sure other programmers don't put backdoors and callbacks in my site!

How can I look for any client side call backs in javascript. I have people adding javascript code for me. how do I make sure they are not somehow sending confidential data or user info to their sites through client side POST, GET, AJAX or any client side methods! How would I do the same thing for my server side code like to see my php p...

JavaScript code to place activity indicator to a cell

Hi all, I am using the following code(no my own code) to load image to a css element (called cell) and to display an activity indicator. var cell = document.createElement('li'); cell.textContent = this.labelForIndex(index); var indicator = new NKActivityIndicator(); indicator.init(10,100,20,"white"); indicator.show(); indicator.spin(...

Online file editor

How can I create an online file editor? My web application will allow a user to create a new text file, edit it and save it. He can do so with multiple files open in multiple tabs. ...

Jquery/Javascript Animation: Interesting Question

How would I go about making divs appear and disappear in sequential order? My plan is to have a 6 different divs: 1-6 appear in sequential order. Then after a couple of seconds, they will disappear (6-1) and reappear in sequential order again. ...

Submitting form with Jquery Fancybox and then appending value into parents text field

Hello everyone, I have a jQuery auto-complete field that selects clients email adddress's. Next to that is a button that allows the user to create a new client. To avoid the clients being taken away from their already half filled form I am opening the form within a lightbox. Enter jQuery Fancybox. The new client add form is located wi...

How can I do cross-domain postMessage?

The documentation for postMessage implies that cross-domain messaging is possible. However: // When the popup has fully loaded, if not blocked by a popup blocker That isn't a very clear note of how to actually do it. In the meantime, I have created two websites: Parent hosted on qc-a.nfshost.com Child hosted on qc-b.quadhome.com ...

jQuery: HTMLInputElement has no method 'val'

I'm looping through cells in a table row. each cell has a text box in it, and I want to take the value of the text box and push it onto an array. function dothing() { var tds = $('#'+selected+' td'); var submitvals = new Array(); tds.each(function(i) { var val = $(this).children('input')[0].val(); ...

javascript file not being cached?

Hi guys, I'm trying to optimize my web application and unfortunately have ended up with a javascript file size of around 450K - that too after compressing [it would take a while for me to redo the javascripting but until then I have to go live] - I initially had made a number of small javascript libraries to work upon. And what I do is I...

Sending mails from localhost to gmail or yahoo or rediff ?

Hi i am working on sending email to any recipient like yahoo gmail my code is contact form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Email Form </title> </head> ...

Difference between window.location.href and top.location.href

Can Anyone tell me the difference between window.location.href and top.location.href ???? And also where to use which one.. And which one will be better when redirecting after an ajax call in mvc??? ...

globalCompositeOperation

I have tried to use globalCompositeOperation in a loop passing it different string (source-atop, source-over etc.) in the same 2D context but I noticed that Firefox let draw me only few shapes while Opera only the last. Now, my question is can I use only ONE globalCompositeOperation at time into the current context? ...

JSON = "XXX is Null or not an Object" in ie6, ie7 (not ie8, FF, Ch)

Why am I getting an error in my json use in ie6 and ie7, but no other browser? I'm parsing with: $.getJSON('http://www.brettbarros.com/wordpress/?post_type=projects&amp;json=get_post&amp;include=title,content,attachments&amp;post_id=8', function(data) { alert(data); }); I'm parsing a json feed from the wordpress plugin JSON API: ...

How to disable browser default password pop-up?

I am developing a Google chrome plugin. under the options page I am running a AJAX request to the server that requires PASSWORD I just want to catch the error if Password was incorrect, but browser is giving a popup window. Can I disable it and how? ...

Disconnect a jquery connection after an inactivity period

I'm using TCP keepalive on the server side to keep the connection alive, and notify the server if the client dies. How can I configure jQuery.get() to disconnect the connection after a certain period of idle time? Edit - I would like to consider "idle time" as time where no TCP packets are exchanged. Since the Server has TCP keepalive, ...

jQuery $.extend() - how to not add new members to the first object if they don't exist?

I just stumbled over a small problem when extending javascript objects using jQuery. When executing var item = $.extend(options.itemDefaults, item); options.itemDefaults is extended with the properties that are already in item and the result is passed to item. So far, so good. But the next time this line is executed, options.itemDefa...

Large image floating popup on mouseover

I'm looking at showing a large version of a thumbnail in a ruby on rails application when the user hovers over an image. The large version would be shown as a floating popup (near or at the mouse cursor) and disappear if the mouse moves away. When I say large image I'm talking about around 300x300 (where the thumbnails are under 100x100)...

speeding up ajax requests - can gzip compression be applied?

Hi guys I want to speed up my ajax requests, I'm returning large amounts of information from the requests and was wondering if any sort of compression could be applied here to speed things up a bit. My ajax requests typically all send in JSON encoded objects such as objects and arrays which contain html elements and other stuff at time...

Is it possible to fire up a pop up like windows from a UIWebView?

How can I make a UIWebView's html/javascript to trigger a UIModalView to show up on page load? ...