javascript

jQuery Fancybox get id value of a

Hi all, what I'm trying to do is get the ID value of the referring a. The code for my a looks like: <a class="photoBig" id="<?php echo $photo['id'] ?>" href="<?php echo $f->buildPhotoURL($photo, 'large') ?>" title="<?php echo $photo['title'] ?>"> I'm using phpFlickr to assign the ID's plus some various other things, which works fine....

How can you tell the difference between a generated and a selected element?

Is it possible, in either the jQuery API or the DOM, to check if an element exists on the page or not? Consider these two variables: var selected = $('span#mySpan'); var created = $('<span id="mySpan">Testing</span>'); Both will return a jQuery object containing a span element. Is there any way to tell that the first exists on the pa...

JS to update the window Location with a URL not a HASH

Hello, I'm building a web app for Sign In / Registration etc, and do not want the page to have to refresh. www.mysite.com I know how to set a hash on the URL without refreshing the page: location.hash to give: www.mysite.com/#signin But what I want: www.mysite.com/signin Without the hash so it's SEO friendly. Also, once I set tha...

Add Javascript Dynamically at Runtime Silverlight 4

I am trying to have a method in my code behind at runtime add a function at runtime. I can dynamically add elements to my document with no problem. So I tried the same strategy for adding a script block. Here's what I have tried thus far with no luck. It can create the script block but when I try to add the function. The only thing I ca...

what is a more elegant way of toggling a javascript timer

I made and use this one, but I know theres better ways : function toggle_timer() { if(timer_id > 0){ clearTimeout(timer_id); timer_id=0; } else timer_id = setInterval("go()", interv); } Its based on the assumption that youll only use 1 timer (otherwise, who knows which timer youll clear?) So far this has...

magento bundle.js error

I just discovered on my site using magento 1.3.2.2 that on a bundled product, when adding different options the price does not change in internet explorer. It works fine in all other browsers however. In internet explorer I get the error message. Message: Object doesn't support this property or method Line: 34 Char: 9 Code: 0 URI: /ski...

Client-side javascript to support promises, futures, etc.

I'm really interested in implementing Promises and related features in client-side Javascript. From what I've seen, the focus in implementing these technologies in Javascript seems to be on server-side javascript (SSJS) with Promises in CommonJS. Ideally for me, I would find a solution that works well with jQuery or Google Closure Librar...

Set a breakpoint in XHR in Chrome

I have a page that sends an XHR request when a form is submitted and I would like to get Chrome to break when it receives a response. It seems like the best way to accomplish this would be if Chrome has a javascript function that I can call that breaks execution but I've been unable to find anything like that so far. Is there another sol...

Variables in CSS / Codeigniter?

Hey, I'm trying to set variables in my CSS so that I can allow subscribers to customize the colors of their page. I'd rather have as many files on my static server as possibly. Is there a good / easy way to do this? Should I just have a CSS file containing all the editable parameters in a CSS file inside the application? Walker ...

Trouble with 2 session_id()'s on my site - PHP/Jquery.

I'm trying to build a site that runs without refreshes, using Jquery and PHP to populate divs that slide in/out. basics work OK, but I am having trouble passing session values around. I have a login panel first that captures "$user" in PHP and then stores is as a session variable $_SESSION['user']. I can then use it on the first page...

Determine web browser selection/focus color from JS?

Is there any way, from Javascript, to determine either the system's selection color (the color it makes text that the user selected), or the system's focus color (the color that is added to the outside of a tab-focused link or form element)? ...

Dynamically shorten/hide/overlap tekst in table cells when too long

My table has static width values but sometimes table cells of a certain column can contain text which is too long and which messes up the table's width. I'm looking for a way to dynamically shorten text (kind of like a table grid functionality but then without grids) because it can be of a variable length, and when one hovers over the ta...

Cross browser alternatives to eval

My html page dynamically loads pages via Ajax for dynamic panels on the page. I need the script tags in the dynamically loaded pages to be executed. I fixed the code from a SO question. It works fine on FF/Safari/Chrome. But dom nodes of type script work differently on IE. -- I can't seem to add text to a script node in IE 7: // varia...

Classic ASP - How to pass a variable instead querystring (refresh) via Jquery(no refresh)

Hello , i'm working on this application that has a calendar on a page that has a lot of request.form("var") inside. This is a monthly calendar and it has on the top previous month and next month . When i click now on next month i get an URL like: ?date=8/14/2010 My question is how to pass this value to the calendar via jquery with no pa...

Can I apply shorthand css to elements using jQuery's .css() method?

I'm trying to apply unknown styles to unknown selectors and it would seem that shorthand css cannot be applied using jQuery's .css() method. Is this correct? Is there a work-around? Note that I am building the object dynamically to be passed in to the .css() and do not want to use .css('background','#000') syntax. $('#example').css({ba...

What is the .call() function doing in this Javascript statement?

Hello all, I'm actively learning javascript, and I came across the following statement: Object.prototype.toString.call([]); And I don't know what it means or what it does. I have a vague understanding of .call, in that it allows you to call a method in the context of a different object (I think), but I am having a hard time unders...

How can I incrementally load html in Webkit?

Hi, I have a large amount of XHTML content, that I would like to display in WebKit. Unfortunately, Webkit is running on a mobile platform with fairly slow hardware, so loading a large HTML file all at once is REALLY slow. Therefore I would like to gradually load HTML content. I have split my data in small chunks and am looking for the p...

How do I bundle a specific webkit build with my Cocoa App

I've got a Hybrid Cocoa/Webkit application that has extensive Javascript usage, and seems to break every time Apple updates the Safari browser (or the underlying webkit framework in OSX). I understand it will probably mean a much bigger binary, but is there a way to force my application to use an older, bundled WebKit framework vs. the ...

How to split the date , time using javascript ?

How to split the date,time using java script ? I am getting date,time 2010-05-04 20:13:12.0.But i need only date. date format mm/dd/yyyy var cdate = gridline[i=1]["CDATE"]; Now i need cdate as mm/dd/yyyy only. Please help me. ...

Inline SVG Animation: Compatibility Oddities

I've been working on this for some time, but can't seem to find an adequate solution yet. The page is XHTML with inline SVG which is animated with ECMAscript once the SVG is finished loading. There is a 0.5s pause, then an eye in the middle opens. It works on Safari, Firefox, and Chrome on MacOS X. The problem is in Chrome on Windows t...