javascript

using CSS3 transform:rotate in IE origin problem

I'm working on a project that uses the new CSS3 transform:rotate(180deg) feature. Every modern browser has it's own tag, but does support it. Only IE (of course) doesn't. But with using filters the same thing can be achieved. The only problem with that is, is that IE uses another origin as CSS3 does. My guess is that with some math the o...

Use a "x-dom-event-stream" stream in javascript ?

Hello, HTML5 draft contains an API called EventSource to stream data (notifications) trough javascript using only one server call. Looking it up, I found an exemple on Opera Labs of the javascript part : document.getElementsByTagName("event-source")[0] .addEventListener("server-time", eventHandler, false); function eventHan...

How to create Site quick tour of the page's new features? (like one youtube has tooday)

So I want when user cliks on a buttom UI to be blocked and tour started... Are there any librarys for that? ...

get click from a link inside a google maps info window

I m making a google maps with some coordinates and directions and when a user clicks a marker and appears a info window there's a link avaliable, when user clicks it, i want to catch click event inside info window, and make zoom to this marker, anyone had to deal with link clicks in google maps api could help me with some links, document...

Using window.onscroll event to detect page/frame scrolling

I want to postion a DIV inside a page such that it is visible to the user even if the user vertically scrolls the page. The page has a heading at the top of the page which is 75 px tall. Now when the user is at the top of the page and has not scrolled vertically, the DIV must be postioned below the heading. However, once the user scrol...

How can I validate/secure/authenticate a JavaScript-based POST request?

A product I'm helping to develop will basically work like this: A Web publisher creates a new page on their site that includes a <script> from our server. When a visitor reaches that new page, that <script> gathers the text content of the page and sends it to our server via a POST request (cross-domain, using a <form> inside of an <ifr...

CSS: resolution problem

my site has three div elements, header, content and footer. i have a picture in header, and i want, that under big resolutions too it looks nice. so i take big image, with 1800px width. by so it looks nice in resolution of 1800, but now, in small resolutions(for example 1024), it shows only first 1024px of my picture, but i want it to sh...

Combining DOM0 and DOM2 event handlers - cancelling of event possible in the DOM0 handler?

Dear expert, please consider the following problem: (1) You have assigned an inline event handler to a DOM element, like so <a id="link1" href="..." onclick=" ... ´"> (2) You also assign one or more further event handler(s) to the onclick event of link1 with the DOM2 or IE-specific assignment mechanism. The verified behavior in FF3.0...

How can I remove an inline onclick attribute with a bookmarklet?

There is an annoying website out there that foils attempts to "open in new tab" by using <div onclick=> instead of <a href=>. I've written a bookmarklet, using jQuery, that creates a wrapper <a> tag and inserts it within the <div> around its content. How can I remove the original onclick handler? ...

Android Webkit: Absolutely positioned elements don't respect z-index

Nasty little bug, this one. As illustrated in Android ticket 6721, the Android browser seems to not respect z-index when absolutely positioned elements are laid over the top of <a> or <input> tags. I am desperate for any sort of workaround. Has anybody conquered this one before? Thanks in advance! ...

Simple jQuery code contains a syntax error that I can't find

I've got this (remarkably) simple JavaScript function that is called when a user clicks a "Cancel" link: function hideNewUserPanel(){ $('#create_user_panel').slideUp('slow'); $('.right_interior_panel').slideDown('slow'); } And the code to add the handler: $(function(){ $('#cancel_create_user_btn').live('click', f...

Using jQuery to echo text

Is it possible to use jQuery to echo text in place of a script tag? More precisely, is there a way to accomplish <script type="text/javascript"> document.write("foo"); </script> ... without the use of document.write? I am not happy about using document.write after reading this. I am aware that I could alternatively do this: <spa...

JavaScript To Strip Page For URL

We have a javascript function we use to track page stats internally. However, the URLs it reports many times include the page numbers for search results pages which we would rather not be reported. The pages that are reports are of the form: http://www.test.com/directory1/2 http://www.test.com/directory1/subdirectory1/15 http://www.test...

Developing a jQuery plugin that returns a given object, instead of jQuery object itself!

Hi, Consider the following base code: (function($) { $.fn.myPlugin = function(settings) { return this.each(function() { //whatever }); }; }); The plugin returns a jQuery object. The question is how am I supposed to write a plugin that returns a custom object so that I can do something like this: v...

Javascript cookies vs php cookies

Is there a difference between javascript cookies and php cookies? ...

Can jQuery animate() behave differently for specific elements within my selection?

I have a selection of elements in a jQuery object. I want to animate their font sizes, but as I have both the headlines and various paragraphs in the selection, they should be animated slightly differently, as the headlines should end up with a larger font size than the paragraphs. I already have this information stored in the jQuery dat...

How to convert a fixed height/width-fixed layout to elastic?

I used the same software used here http://us.gn.bartal.org/ to create a fixed width/height treemap in HTML + CSS. I would like to make it elastic by having a JavaScript function to convert all pixels absolute positions and sizes to percentages. How would you suggest to proceed? Is there some jQuery/Prototype/Dojo magic that I can explo...

Jquery to javascript conversion help

I'm trying to convert the following jquery to javascript syntax, but being not familiar with either, I'm getting stuck var div = $('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div>'); // Append our div, do our calculation and then remove it $('body').append(d...

JSON limitation?

Hello, I would like to know if JSON with AJAX has a limitation to the amount of data an outgoing and returning parameter can carry? I would like to be able to send and return from the server a file with 10,000 lines, as a string. How should I achieve this task? Will a single parameter will be able to hand this? EDIT: My client is Java...

Javascript focus and select not working in FF

Hey guys, Using jQuery, the following is not working in FF, but it is in IE $(this).focus().select(); I looked around for this and found that you could use a timeout to get around this, but that is not something I want to do if I can avoid it. Does anyone know another way to do this and have it work in FF? Metropolis ...