javascript

javascript scroll event for iPhone/iPad ?

I can't seem to capture the scroll event on an iPad. None of these work, what I am doing wrong? window.onscroll=myFunction; document.onscroll=myFunction; window.attachEvent("scroll",myFunction,false); document.attachEvent("scroll",myFunction,false); They all work even on Safari 3 on Windows. Ironically, EVERY browser on the PC supp...

Accessing selected node of richfaces tree from Javascript

Hello This should be a very simple question. I have a richfaces tree that is rendered using JSF. When the user clicks on a node I want a javascript function to run. Nothing more nothing less. No redirects, no re-submit, no-rerender, no Ajax. Just plain old Javascript. I have seen the onselected attribute of the tree and it indeed fires...

Highlight changes?

HTML: <html> <body> <textarea>Original Text</textarea> <button>Replace</button> </body> </html>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ jQuery: $(function() { $('button').click(function () { $('body').html($('body').html().replace('Original','New')); }); }); ​ http://jsfiddle.net/r7MgY/ ...

how to insert PHP code snippet in javascript

my code- <?php session_start(); $_SESSION['errors']="failed"; ?> <head> function myfunc() { alert(<?php echo $_SESSION['errors']; ?>); } </head> <body onload="myfunc();"> but alert msg is not popping up. ...

how to remove the link from the following javascript?

hi i am unable to the remove the link from the keywords which are coming from database.... var googleurl="http://www.google.com/#hl=en&amp;source=hp&amp;q="; function displayResults(keyword, results_array) { // start building the HTML table containing the results var div = "<table>"; // if the searched for keyword is not in the cache...

Can i call/request a .net handler (ashx) using javascript?

Is it possible to call a handler using javascript code? e.g. i have a handler deployed at this location http://mysitename.com/getMyData.ashx. Can I call this handler or just request it using javascript? Is it even possible or not? Please suggest. ...

jQuery Ajax form submit, to call php login script

Thanks for checking out my problem... I'm having trouble submitting a login form via Ajax for a php script to run and return a new set of html items which will be replacing the HTML in #userlinks.... heres what I have so far $("#login_form").submit(function() { return false; }); $('#login_button').click(function(event) { $form = $(...

To set the maximum length to Text Area in ASP

What's the best way of restricting the maximum number of characters that can be entered into an asp textarea? ...

jqGrid - edit only certain rows for an editable column

Hi, Another jqGrid question: Is it possible to disable editing for certain cells in a column that is marked as editable? From what I've seen, the only options are "all cells are editable" or "no cells are editable". Is there a way to work around this? Thanks, Cosmin ...

Help me understand javascript:void(null)

can someone please help me with this javascript:void(null) I found it used in link buttons as follows <a onclick="ProcessResponse()" href="javascript:void(null)" >Accept Data</a> ...

value was "" blank when refreshing the page manually

Hi, I have a problem regarding the maintaining of value when page was refresh.I assign a value into a hidden control using javascript below: function displaytab(tabID) { var tabId = document.getElementById("ctl00_MainContent_tabId"); switch (tabID) { case 1: tabId.value=1; break; case 2: ...

How to fix this window.open memory leak?

Hi there, I was recently looking at this memory leak tool sIEve: http://home.orange.nl/jsrosman/ So I decided to test out the tool by creating a main page that will open up a popup window. I started by creating 3 pages: index.html, page1.html and page2.html, the index.html page will open a child window (popup) linking to page1.html. Pa...

e4x filter on more than one children?

My XML Looks like this: <?xml version="1.0" encoding="utf-8" ?> <projects> <project id="1" thumb="media/images/thumb.jpg" > <categories> <id>1</id> <id>2</id> </categories> <director>Director name</director> <name><![CDATA[IPhone commercial]]></name> ...

jquery $.getJSON only works once in internet explorer

I have a php function which inserts a searchbar into each page on a website. The site checks to see if the user has javascript enabled and if they do it inserts some jquery ajax stuff to link select boxes (instead of using it's fallback onchange="form.submit()"). $.getJSON works perfectly for me in other browsers except in IE, if I do ...

tips on writing my first html embeddable widget?

i have been asked by a client to develop a javascript(mootools)/html/css/php based game as a widget which can be deployed anywhere. I have not written a widget before, so would love to get some tips and experiences so that i know some of the pitfalls before i start! Thanks :) Dan ...

How to calculate if mouse pointer at bottom page using Prototype?

I want to create auto-hide menu, just the same thing like http://www.ringvemedia.com/shanghai-photos but the problem is that I also have content that is scrolling down so if I calculate pointerY it will return mouse absolute position so it could be 1000...999999 depends on how many content you have to scroll down, that why I cant use som...

Add Class using jQuery

My Html mark-up is somthing like this <div> <div></div> <div></div> <div></div> <div class="last"> <div class="a"> <div class="b"> <div class="c"></div> </div> </div> </div> </div> Want to add a extra class in <div class="last">,<div cla...

Flex vs. jQuery vs. GWTvs./ Closre vs. Cappuccino vs. plain JS and HTML5?

Hello, I'm creating my first web application and I'm really confused as to what technology to go for. My application needs to look serious (like an application), it doesn't need many colorful graphical interfaces. It only needs a toolbar, a tab bar, a split panel (preferably 3 columns), an easily-formatable text field, and a status bar...

JQuery Hover li Show div which sits outside li structure

Hi everyone I'm currently trying to create a "mega" dropout menu using JQuery but have encountered an issue I'm yet to be able to resolve. At the moment I have the following HTML structure: <div id="TopNav" class="grid_16"> <ul class="cmsListMenuUL level0" id="TopNavMenu"> <li class="cmsListMenuLIcmsListMenuLI highlightedL...

Javascript detect event handlers available on HTML element

Is there a way to detect what event handlers are available natively for an HTML element? For example: isAvailable(img.onload) === true; // All browsers isAvailable(script.onload) === true; // Non-IE only (Webkit, Firefox, Opera) isAvailable(link.onload) === true; // IE (and I think Opera) only Ideally I want to do feature detect...