javascript

How to trigger Mouse-Over on iPhone?

This might seem like a really dumb question, but I am writing an application and I have come across where my mouse-over, mouse-click and mouse-hover need different events bound to them. Now on Internet Explorer, Firefox, and Safari. It all works as expected. However, on my iPhone the actions will not trigger. Now my question is are the...

jQuery - remove list items based off of time

I currently have a page that contains an unordered list. That list is initially populated by querying my db, with each list item having a time stamp and text. Using javascript and AJAX, this page updates the unordered list dynamically every 10 seconds, if new data has come in. What is the easiest and most efficient way to remove lis...

Need a quick jquery solution to capture the current url and inject it into another url link

Howdy, My brain is fried ATM and I have a looming deadline, I am looking for a way to grab the currently viewed pages url and place it into another link for bookmarking/social links. Facebook link:http://www.facebook.com/share.php?u=[PAGEURL] Myspace link:http://www.myspace.com/Modules/PostTo/Pages/?u=[PAGEURL] Twitter link: http://twi...

Dynamic Div Height Calculation - JQuery/AJAX

Hello, I've written a small lightbox plugin for jQuery (yes, there are several ready made packages -- unfortunately, the designer in my co. does not like any of them). I have one small problem -- I am using .load() to load dynamic flash content into the lightbox div. I am appending the div to the DOM, presetting visibility to hidden, a...

image position and clipping

hi, does anybody knows how to place an image in the webpage, but both position and clipping (maybe also resizing) are interactively done by user ?, i need it for my registration page, i've done some clipping and resizing from css and javascript, and it's not really solve the problem. If it's can be done by php, it will be perfect ! thx. ...

Lexer written in Javascript?

I have a project where a user needs to define a set of instructions for a ui that is completely written in javascript. I need to have the ability to parse a string of instructions and then translate them into instructions. Is there any libraries out there for parsing that are 100% javascript? Or a generator that will generate in javascri...

jQuery html() converting braces to html entities (sometimes)

Basically: I have this HTML: <div id="foo"><img src="/foo/bar/{var}/foo" alt="{var}"></div> When calling (using jQuery in Firefox): $("#foo").html() I get: <img src="/foo/bar/%7Bvar%7D/foo" alt="{var}"> My desired output is: <img src="/foo/bar/{var}/foo" alt="{var}"> What's going on here? Any tips for how to resolve this? I...

javascript for enabling/disabling 2 date range/date in Cognos

I am looking for javascript for enabling/disabling two date range/date prompts in Cognos. Does anyone have any javascript for disabling/enabling two date range prompts? If I select the Date1 prompt, then the Date2 prompt has to be greyed out and vice versa. I am using Cognos 8.3 SP2. ...

Google maps API can't get the longitude

Hi guys, i'm trying to get the longitude and latitude for an address with the google maps api, but I don't know how to do it?This is an example of what i'm trying: GoogleObjectAdress("New york") -> and it should return the longitude and latitude for me! Any solutions? ...

Finding the joy of Javascript or searching for another UI-focused languages?

Hey everyone, I'm a GUI designer/interactive musician wanting to improve my programming chops. I already know the basics(variables, loops, arrays, if/else, some logic), but I'm looking to learn in a structured way. I've seen some great books/tuts on Python and Processing (and even Flash)that aim to teach the fundamentals of programming ...

Hiding the text input cursor (the caret) showing through overlayed elements Internet Explorer

I have a form with a special widget that fills in a text input. When the text input has focus, the widget appears above the text input (intentionally above it) and the user clicks options in it, when they're done it disappears and fills in the input. There is a problem with this in IE, when the widget appears above the input, the field's...

Validating Form Data and Displaying Graphics with JavaScript

I have not really used JavaScript before but I am trying to validate form elements as they are being filled out. I have an X and a Check mark that I am trying to display next to the field to show if it is valid or not. I know that this is partially right because I can use an alert but I am not sure how to alter the fields of the graphics...

Javascript - replacing a word using regexp only if there's a space around it.

A cut down version of my code sort of looks like this: string="test test testtest testtest test"; replacer="test"; string=string.replace(new RegExp(' '+replacer+' ','gi')," REPLACED "); Now, I want to replace a word only if there's a space surrounding it, The code actually works fine but I'm just wondering why the one below which woul...

YUI3 calling a function

top.on('click', function(){ anim.run(); }); I have an anim function, and was wondering why I can't call it like this top.on('click', anim.run); ...

Variable assignment in JavaScript

hi Friends, I have a js function I want to assign a variable to a variable my variable is in a forloop I have two variables ie; var spcd_1= "http://www.colbridge.com"; var spcd_2 = "http://www.google.com"; below is my js function function openNewWindow(spcd) { //alert("hello"); var tt = spcd; alert(tt); var i=0; var spcd_1= "htt...

How to detect which row [ tr ] is clicked?

In javascript, how can we detect which row of the table is clicked? At present what i am doing is, i am binding the the method at run time like this. onload = function() { if (!document.getElementsByTagName || !document.createTextNode) return; var rows = document.getElementById('my_table').getElementsByTagName('tbody')[0].getEl...

Javascript rowIndex method is not working

I am using the rowIndex property of TR but it is not working. Please let me know if i am doing something wrong here. function myMethod(){ alert ( this.parent.rowIndex ); // parentNode is also used } Html <table border="1"> <tr> <td onclick="myMethod();">1.1</td> <td>1.2</td> <td>1.3</td> ...

Viewing LCOV file in Windows

Hi all: Background: I have used JsTestDriverCoverage and generated a test coverage report for my Javascript unit tests. However it is in LCOV format. As a Windows user running on Windows 2003, I can't just read the file since its perl/lunix friendly. Question: are there any ways to either convert the file to a more readable format (u...

Opening Print-HTML-Popup from Flash?

Hi, is it somehow possible to open a HTML popup window from within Flash and have it receive text data from Flash which should be printed ... and this all only in AS3 and Javascript (since no server-side scripting is available)? ...

Detect Browser Close on Asp.net

I want to do some functionality on log-out, if the user directly closed his browser then same functionality want to do, we can not do on page unload because there are more than 100 pages in my website because this will work on redirection from each page Thank You ...