javascript

Using canvas to grab pixel data from page

Hi canvas experts, If I have a QT video on a page (where QT is a requirement that can't be changed) how can I grab the pixel data of the current frame that is being shown with canvas? I am aware that this is possible with getImage(videoElement, .....) but I am looking for a solution that uses QT. If getting the pixel data is not possib...

Javascript Error in IE Using the Prototype library in Rails

I'm running a Rails app and using prototype. The script breaks in IE, but works in all other browsers. I appreciate any help in guiding toward a fix for this. Here's the problem: My users sell products and varieties of products. The varieties available are dependent on the product. For example, if we're talking about fruit, the user ...

Jquery - how to use $()

How do I convert the following javascript to using JQuery? document.getElementById("asc").removeAttribute("href"); document.getElementById("asc").onclick = ""; document.getElementById("asc").style.textDecoration = "underline" I think I'm close using the below code but this doesn't quite work. $('#asc').attr('href', '').click(function...

Finding the position of current td cell when click on.

Hello, Im trying to find the current cell that the user has clicked on. For example if the user clicked on the first cell, I want to return 1. If they clicked on the tenth cell I want to return 10. There are 16 total cells in the table. <html> <head> <title>Lights Out!</title> <script type="text/javascript" sr...

Not knowing how to position the output of Javascript in an HTML page

Hi folks, I am a javascript beginner . I am working on a wordsmith game that display's a clue (on the roll of a dice ) to a word . now i need to display the blank spaces of the word and a clue below it . I am not knowing hot to display the content to the place i want in the page ??? <html> <head> <script type="text/javascript"> form1= ...

IE Issue: Submitting form to an iframe using javascript

Hi, I was trying to create an iframe element using javascript, like so... var iframe = document.createElement('iframe'); iframe.setAttribute('name', 'frame_x'); However, when I tried submitting a form using the newly-created iframe as target, IE opens up a new window, instead of using the iframe. form.setAttribute('target', 'frame_...

Determining codec support for HTML embedded video in Javascript? In native code on Linux?

Hi guys, I'm wondering whether or not it is possible to determine if a machine has codec support to play a file located at a given URL. We are using the embed tag such as <embed src="http://www.tizag.com/files/html/htmlexample.mpeg" autostart="false" /> My guess is it is not possible to determine if a machine has the capability to p...

jQuery effect on iframe parent document

Just wondering if anyone else has experienced this or knows why I am getting an error. I'm using javascript from within an iframe to call a parent dom element then use jQuery UI's effect core to shake it. Here is an example: $(document).ready(function(){ if ($("form").length>0) { $("form").submit(function(){ ...

How to Stop Gmail from maximizing an iFrame?

I am trying to create a webpage with Gmail embedded in an iframe. However, Gmail has some javascript code that executes whenever it is loaded. I believe the following js code snippet is what causes Gmail to hijack the window and maximize itself, destroying my parent iframe: if (top.location != self.location) { top.location = self.loca...

I need to to open a new window in the background with JavaScript, and make sure the original is still focused

I have a window I'm opening with a Javascript function: function newwindow() { window.open('link.html','','width=,height=,resizable=no'); } I need it that once the new window opens that the focus returns to the original window. How can I do that? And where do I put the code - in the new window, or the old one? Thanks! ...

Align background image middle and center

Hi Team, Here's the html: <div class="gallerybox"> <a href="/CustomContentRetrieve.aspx?ID=398791"> <img alt="" src="/Utilities/image.jpg" width="400" height="400" /> </a> </div> Here's the css: .gallerybox {width:200px;height:200px;overflow:hidden;} Can anyone tell me a way to align the linked image inside div.gallerybox middle (...

Problem in reference js file for IE7/8

I have a very strange problem in an ASP.NET page, the following reference of JavaScript file works well in IE6 <script src='~/Scripts/xxx.js' type="text/javascript"></script> But not working in IE7/8, I got object required error when load the page change to the following works: <script src='<%# ResolveUrl ("~/Scripts/xxx.js") %>' t...

How to instantiate a Actionscript class that is "movie-less"

Hey all, I am a total flash newbie, and I'm looking to build an audio player that uses flash in the back-end, javascript in the front-end. Therefore I do not need the "movie" capabilities of flash. I have the actionscript class that runs the audio, the javascript that tells the actionscript to play, and swfobject to embed the flash. I d...

render / call .aspx page html into another .aspx page

in my application, i have implemented ajax 4.0 client templates currently my templates resides on same .aspx page. (say Main.aspx) but i want to externalize them.(ie all the HTML would go on another page) for that i have used $.get() like $.get("/Module/getTemp/" + TemplateName, function(result) {... now, i want getTemp function i...

Close iframe cross domain

I am trying to do something similar to the Clipper application here http://www.polyvore.com/cgi/clipper I can make the iframe appear in another website (cross domain). But I cannot make the "close" button to work. This is what I used but it doesn't work for cross domain (basically remove the iframe element) window.parent.document.getE...

JavaScript: Closures help

I have an empty .js file with this code in it: Cart.CheckoutNow = { ... } // Alias if (typeof(CheckoutNow) === 'undefined') { CheckoutNow = Cart.CheckoutNow; } else { alert('CheckoutNow is already a variable in window.'); } How can I have the // Alias code appear at the top of the page, but have it execute after Cart.Checko...

IE smoothing a map pan when dragging

I've trying to smooth out the performance of a map application i've been building using javascript. I initially implemented a dragging pan using onmousedown onmousemove onmouseup However in IE it feels really sluggish and it appears that when you move the cursor really fast the map doesn't update it position until you stop moving. I...

javascript dates in IE, NAN - firefox & chrome ok

I'm trying to build a little calendar in javascript, and I've got my dates working great in Firefox and chrome, but in IE, the date functions are returning NAN. Here is the function function buildWeek(dateText){ alert(dateText); var headerDates=''; var newDate = new Date(dateText); var...

Small Image Hover Views Big Image (Not Separate Window, though)

I Want That hover on Small Image Views Big Image in same window... So can anybody help me in dis... ...

Javascript embed code that doesn't halt page rendering

I'd like to embed a number from another page. The remote call is small (only returns a number) but I would like the page to keep loading while the request is out. How should I do it? I'm currently doing <span id="target">Loading ...</span> <script> var cb = function(data) { document.getElementById("target").innerHTML = data; } </sc...