javascript

how to disable MobileSafari auto-selection?

my webapp requires users to tap and hold on an element for a game action, but iPhone automatically "selects" the area which is confusing to the user. anyone know what html elements prevent selection, or if javascript can block selection? any help is appreciated ...

file tree using ajax call for branches

I`ve tried to make an animated file tree using this Ive used the way without jQuery. But the list is getting long and I thought that may use ajax to call a php script and then to add the output of it to the tree. But it dosnt work. I`ve changed the php_file_tree.js while (1) { if (node != null) { if (node.tagName == "UL") {...

jQuery replacement for onclick

Hi Everyone, I've just recently discovered the power of jQuery. Just a quick question though. What is a replacement for onclick="DeleteSomething('THE ID NUMBER LOADED IN BY SERVER SIDE')" ? Is there even a way somehow to pass custom information such as an ID to a jquery onclick? Or do i have to stay with the old fashioned way? Than...

Why doesn't the image 'src' gets replaced with this javascript ?

var x = document.getElementById("pic"); x.src='path.jpg'; Shouldn't this replace the source of the the image with the id 'pic' ? What am I doing wrong? When I right-click and check the source of the html in my browser, the image 'src' have not yet been changed! Thanks ...

Basic Javascript question: How to open a new window?

How do I open a new window in javascript properly? I've tried: <a href='javascript:window.open("testing.html","mywindow","menubar=0,resizable=1,width=200,height=500,left=0,top=0");' >New Window</a> This causes a new window to pop up but in Firefox it leaves the original page with a blank window saying "[object Window]". I've also had...

How can we convert a string (2007-01) to date in javascript?

How can we convert a string (2007-01) to date in javascript? ...

What's different when a page is opened by window.showModalDialog?

Anyone knows the difference? The problem I met is that the page stops working correctly when opened by window.showModalDialog ...

jQuery matching ID with a ' = ' in it

Hi all: Has anyone tried matching an id with an equal sign (=) in it, and WORKED? E.g.: // DOM structure /*DOC += <span id='Test=Test' class='something'></span> */ var test = $('#Test=Test'); I tried the above code. jQuery doesn't like it and returned undefined. However if I match the span's class, I could actually find the span (...

How to update an GridView in JavaScript?

Hi guys, I have following given: I must have a grid-like control, at the moment I use ASP:GridViews I must update label in it specificly every second (there are countdowns in it) At the moment, as I sayed, I use GridViews. Pro: Update very easily over CodeBehind Easy to handle in general Easy to load data in it Contra: I mu...

Using JS how can I stop child Iframes from redirecting or at least prompt users about the redirect

Many sites have scripts similar to the one below. These are put to stop other people from framing the sites. if (top.location != location) { top.location.href = document.location.href ; } I need some way to realize that the iframe is trying to redirect, and if it is , I will remove the iFrame and instead place a link to the site. Th...

how to create a table with javascript ?

I have this php function, which I want to convert to javascript function, but I don't know how to create a table in javascript. I guess I have to have a container (DIV) to insert the table into with javascript. Here is the php function simplified: (it counts height and width and repeats a 1px shadow to create a drop-shadow effect) fun...

Form entry gets inserted into the HTML code?

I am using following code to display HTML Form on my web page. This code also uses a third-party .js file that is linked to it. Everything is working fine except that when the first record is inserted and after saving the record the control comes back to this form, the company name entered in the first entry is seen in the code itself. I...

Autocomplete filling out Email/Website/Address in Forms in Flash?

How do websites I've never been to fill out my information (email address, name, phone, etc.)? Sometimes they pick my old email instead of my new one, so they must be reading it from something I might be able to access with some javascript. I would like to be able to do something like this in Flash, so any ideas how I could tap into ho...

Need help with jQuery to JavaScript

I want to rewrite this line as vanilla JS so it is applied quicker (and before the downloading of the jQuery library). The line is $(document).ready(function() { $('body').addClass('javascript'); }); If I added it to the html element instead, would I be able to leave off the DOM ready part? One problem with this though is the validato...

how to exit from setInterval in Jquery

i need to exit from a running interval if the conditions are correct: var refreshId = setInterval(function() { var properID = CheckReload(); if (properID > 0) { <--- exit from the loop---> } }, 10000); ...

Login via cURL to Javascript Page?

Hey guys, I'm having some trouble devise a script which attempts a login to a billing portal (Freshbooks) using cURL. I've seen various examples of this online (http://www.trap17.com/index.php/automatic-login-curl%5Ft38162.html) however, none of these examples would with JavaScript. The login page seems to be based on JavaScript and jq...

Any library to convert richtext to html.

At present I am using widgEditor It is a good library in JavaScript but has some minor issues. Is there any other library that can convert a Rich Text into an HTML equivalent? ...

Load and execution sequence of a web page?

Hi All: I did some web based projects. But I don't think too much about the load and execution sequence of an ordinary web page. But now I need to know detail. It's hard to find the result from Google or SO. So I created such a new post. a sample page is like this: <html> <head> <script src="jquery.js" type="text/javascript"></scri...

Scroll to top of page after async post back

So I need to scroll to the top of the page after an async post back in an asp.net update panel. The code I used was this: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestEventHandler); function EndRequestEventHandler(sender, args) { scrollTo(0,0); } However, I only want this to be run when I click on a cert...

set/change value to drop down using jquery

how to set or change value to drop down. I'm having a drop down list which is initially not selected a value. How can i select a value using jquery ...