javascript

Find inside of UIWebView

Hello, I'm having hard time while trying to search inside of UIWebView. I know that I need to use javascript for that but almost everything I found uses replacing the HTML code and searching by element.type. My HTML file is so big that it's not possible to use this approach and honestly I don't need highlighting. Could anyone help me to ...

Insert an ajaxified Webpart into an existing MOSS site

Hi everybody, I need to code a webpart which purpose is to asynchronously fetch some documents and display them into an existing page. Unfortunately I have to face a lot of rescritcions and my struggle to find a solution seems useleess so far. 1) I cannot use Microsoft asp.net ajax 2) I must use Jsonp because the called service (page, w...

JavaScript and CSS order

Hi, I have an HTML file which is linked to CSS file and also to JavaScript file. Is JavaScript executed first and then the CSS is applied, or vice versa ? Is there any way to change the order ? Thanks ! ...

Make an element visible to the user but invisible to events

I'm not quite sure how to describe what I'm looking to do, but I'll do my best. At the moment I have a parent <div>, with absolutely positioned child <div>s within it, and I'm tracking the mouse pointer location coordinates relative to the element your mouse is over. At the moment, when I mouse over my child <div>s, I get the mouse loc...

Custom Jquery slideshow doesn't want to reset?

Hello, Under $(document).ready(function(), I have the following code: num = $("#mainContentCategoryLinksWrapper > div").size(); This makes num equal the length of the children of #mainContentCategoryLinksWrapper. Currently, this equals 4. Above the $(document).ready(function( I have this: var timesRun = 0; function slideshow(){...

Javascript/JQuery - How to get number of specific child elements

I wish to get the number of all TR elements that have a input element in them somewhere. How should I proceed ? Html : <tbody> <tr> <td>Ignore this item 1</td> </tr> <tr> <td>Ignore this item 2</td> </tr> <tr> <td><input blablabla>... Include this TR...</td> </tr> </tbody> Thanks! ...

jquery .unload problem in IE

Hi, I have the following code that works flawlessy in FF, but in IE I get an error that says "invalid property value" The code in questions is as follows: pageOpen = new Date(); dropper = new Image(); $(window).unload(function() { pageClose = new Date(); sionara = (pageOpen.getTime() - pageClose.getTime())/-1000; dropper.sr...

page transitions using javascript

hey, i saw this on a site a couple of days ago and i cant seem to find it again. in any case, this is what was on the site: the page opened regularly when you entered the url. upon clicking one of the links on the page, it "transitioned" to the next page (there was a color change). and the url in the address bar was changed to reflect...

javascript test for existence of nested object key

If I a reference to an object - var test = {}; that will potentially (but not immediately) have nested objects, something like - { level1:{level2:{level3:'level3'}} }; what is the best way to test for the existence of keys in the most deeply nested objects? This - alert(test.level1); returns 'undefined', but this - alert(t...

how to print entire HTML element in JavaScript?

I want to print the entire element including tag name, attribute name/value pairs and innerHTML. How can I do it in JavaScript (jQuery)? for example: var elArr = document.getElementsByTagName('link'); alert(elArr[0].printEntireElement()); //expected output might be <link href="/css/common.css" rel="stylesheet" type="text/css">` Not...

jQuery append HTML with javascript link

I have a situation where I should append html with jQuery. Within this html there is an a-tag with javascript as link. How can I solve this? $(".messages-wrapper").append('<li class="chat-wrapper"><a class="chat" href="javascript:openChat('http://domain.com/Messenger.aspx'"&gt;Chat öffnen<span></span><small>Chat öffnen</small></a></li>...

IE Javascript String.Match issue

The following javascript code concatenates the matches found by a regular expression. The regular expression should find any word or set of quoted words. It seems to work perfectly in FireFox and Chrome, but its not working correctly in IE (i have only tested it on IE8). var searchString = ''; var notString = 'dog cat "pirate ship"'; va...

jQuery - Problem with refreshing the image with same name using attr('src',newimage)

Hi Guys, I am trying to refresh an image on the page but it is not happening. I have a page with images and I need to update those images as required. To update an image I upload the image on a lightbox and then close the lightbox. The image on the page should update itself. Now, I tried $('#imageid').attr('src', newimage). I want to ma...

Simple javascript to mimic jQuery behaviour of using this in events handlers

This is not a question about jQuery, but about how jQuery implements such a behaviour. In jQuery you can do this: $('#some_link_id').click(function() { alert(this.tagName); //displays 'A' }) could someone explain in general terms (no need you to write code) how do they obtain to pass the event's caller html elments (a link in thi...

jQuery wait for ajax call to be over before continuing

Hi all, I have a problem with a jQuery ajax call. I need to wait for the call to be finished in order to return a value. However, the script seems to jump ahead and not wait for the call to be over. my function then returns "undefined". I have tried to use the .ajax() method and set the value of async to false, but this would not work ...

Changing a form's action attribute in IE?

Hey. I'm trying to set a hash value in a form's action, to keep it when the form is submitted. Firefox allows me to update the hash and redirects accordingly, but IE doesn't. I initially thought this was related to IE not allowing hash values in the action attribute at all, but it seems I can't dynamically set the action at all in IE ...

javascript addEventListener memory-leaks question

If I use addEventListener to register an event on an element, then delete the element without removing the event and I did this repeatedly could I create a memory leak ? ...

Is it possible to stop a javascript with Firebug without using breakpoints?

Is it possible with Firebug to stop a javascript with a press of a button or a keyboard shortcut instead of stopping it by setting a breakpoint? Why would I like to do this? We have a very dynamic website with lots of animations. It would be a great help if I could just stop the scripts at the moment the animation is doing something I w...

jeditable dynamic target value

I'm using jeditable and it works really great! I'm just having some trouble figuring out how to dynamically change the target URL. jeditable is bound to a table of values that I want to edit inline. So I have: <td id="<%= col.id %>_<%= i.id %>" class="edit"> The id is a mashup of two values I need to know to edit this item on the se...

Javascript toString method parameters

Dear experts, I'm just wondering what it means to attach a number as a parameter to the toString() method E.g. obj.toString(10); I googled and i have never seen a parameter before. ...