javascript

Jquery-Different between event.target and this keyword?

What is the different between event.target and this? let's say I have $("test").click(function(e) { $thisEventOb = e.target; $this = this; alert($thisEventObj); alert($this); }); I know the alert will pop different value. Anyone could explain the difference? Thanks a million. ...

Google Translate translates inline Javascript Code

Hi, I have some PHP code that sends a section of html code including some inline Javascript code by curl to google. When i get it back from Google translated into the language that i chose, the Javascript code has been translated too. Any ideas as to how i can stop Google translating my inline JavaScript code? Thanks, M ...

jQuery Function Implementation and Function Call ?

What is the difference of calling function like: testCall: function() and function testCall() in jQuery ? Update: Questions: Does usage of one over the another have some performance issues related to it OR it really does not matter which one you are using ? Update 2 Also other thing that I noticed that whenn I am defining function u...

JavaScript array to PHP array then process in PHP and return

Example: javascript: var mycourses=new Array(); mycourses[0]="History"; mycourses[1]="Math"; mycourses[1][0]="Introduction to math"; mycourses[1][1]="Math 2"; mycourses[1][2]="Math 3"; PHP will then run these values through functions (please note values are mostly not strings as in the example above but rather numbers), the ...

Google Maps API v3... non-mobile?

I'm trying to make a Google Maps widget for my website but all of the examples are for full-screen mobile devices. The tutorials work when I copy paste them exactly as shown but they don't seem to work when I want them to only occupy a portion of the page. From what I've read, the v3 is the best API yet (for what I need) because of its ...

How to stretch table cell by dragging like webkit does for textarea?

Webkit adds to the bottom, right corner of any textarea, an icon that you can drag to resize the textarea. I need to create the same affect on a table cell to allow my user to adjust the size of a given cell via drag. I could code this up, but I doubt if it hasn't already been done. ...

access DLLs with java script

I need to read the serial port as an input for a web based applicaton. I know that the browser can't do it, but if I build an DLL and send it to my client, can I access this DLL and read de serial port with an java script or i will need something like ActiveX? ...

jQuery MVC architecture

Hi, what is the best way to create MVC architecture in jQuery? Should I use jQuery.extend()? jQuery.extend({ View: function(){} }); ...or jQuery Plugin? (function($) { $.fn.model = function() { return this; }; })(jQuery); ...or just objects in JavaScript? var model = {} var view = {} var controller = {} Thank you! ...

Javascript childNodes does not find all children of a div when appendchild has been used

Alright, I am hoping someone can help me out. I apologize up front that this one may be confusing. I have included an example to try to help ease the confusion as this is better seen then heard. I have created a webpage that contains a group or set of groups. Each group has a subgroup. In a nutshell what is happening is this page will a...

How can I use Perl to grab text from a web page that is dynamically generated with JavaScript?

There is a website I am trying to pull information from in Perl, however the section of the page I need is being generated using javascript so all you see in the source is: <div id="results"></div> I need to somehow pull out the contents of that div and save it to a file using Perl/proxies/whatever. e.g. the information I want to save...

Regex to match partial words (JavaScript)

I would like to craft a case-insensitive regex (for JavaScript) that matches street names, even if each word has been abbreviated. For example: n univ av should match N University Ave king blv should match Martin Luther King Jr. Blvd ne 9th should match both NE 9th St and 9th St NE Bonus points (JK) for a "replace" regex that wraps t...

Plotting points so that they do not overlap if they have the same co-ordinates

Hi everyone, I have a function that takes longitude and latitude and converts it to x and y to be plotted. The conversion to X and Y is working fine and that is not what I have the problem with. I want to ensure that two points are not plotted in the same place. In one set of results there are about 30 on top of each other (because the...

How to make html-files with content to be used in a simple ajax site to behave nicely in google?

I made some ajax sites in the past where I used ajax to get more of a desktop application feeling for my sites and also to keep the site maintainable. My strategy was making one index page and from there pulling in html content from some subpages. (So far I didn't use ajax to send data to the server.) The problem that I ran into is this...

Publish to Facebook Stream in as3

Hi, I am trying to publish to a users stream when they click a share button in my flash app that i have living in a tab on a fan fan. I basically have my swf embedded on a page that has a java script function that calls the facebook share dialogue. Here is what i got so far: // flash embedd <fb:fbjs-bridge/> // share function <sc...

javascript function document.location working incorrectly

When I change on proxy-server page from cnn.com (I add javascript, that call document.location), result of the document.location is some url of advertisement: http://ads.cnn.com/html.ng/site=cnn_international&amp;cnn_intl_pagetype=mmst&amp;cnn_intl_position=336x850_rgt&amp;cnn_intl_rollup=asia&amp;page.allowcompete=yes&amp;params.styles=...

JSON implementations that handle sparse arrays

I need to know if any JSON implementations can handle sparse arrays to my satisfaction. I've seen the question: http://stackoverflow.com/questions/1733658/how-to-represent-a-sparse-array-in-json but using an object rather than an array is not an option for me; I need an array. My minimum requirement would be that the implementation f...

When should I observe javascript events on window vs. document vs. document.body?

I'm using prototype.js for my web app, and I have everything running on chrome, safari, and firefox. I am now working on IE8 compatibility. As I've been debugging in IE, I've noticed that there are javascript events for which I have previously set an observer on the window, e.g. Event.observe(window, eventType, function () {...}); (...

Implement keyboard control in JavaScript Grid

I finished building a JavaScript grid control, end everything works fine. Paging, button navigation, column sorting, etc. The cells in the grid are DIVs which are generated using Mootools 1.2.4 (which is heavily used throughout the control). I want to implement keyboard control for the grid, both for paging (page up/page down) and for ...

How to get top and left style property values in Javascript

Hi all, I have a little bit of Javascript that almost works correctly. Here's the code: function toggle(curlink) { curlink.style.backgroundColor = curlink.style.backgroundColor == "yellow" ? "transparent" : "yellow"; var maindiv = document.getElementById("grid"); var links = maindiv.getElementsByTagName("a"); var list = ""; for (...

ASP.NET Call Another Element's DoPostBack Function

I have an ASP.NET control that has an onclick event handler rendered inline on the element. I would like to call that function and have it raise the target control's server side event handler. <asp:CheckBox ID="Foo" runat="server" AutoPostBack="true" Text="Foo" /> <a href="#" onclick="javascript:setTimeout('__doPos...