javascript

How to change all $ to jQuery where some variable name starts from $ in some Jquery Plugin??

Hello, I learned from this article that to avoid confliction between javascript libraries, use jQuery.noConflict(); function just before jQuery(document).ready ( function () { }) and replace jQuery at all instance of $ but i have seen many jQuery plugin where $ is used with variable declaration??? here is an example on this link ...

Is it possible to enable CTRL + Dragging for markers in Google Maps?

I'd like the user to only be able to drag a marker when the CTRL key is held down. Is this possible? ...

rotating an arrow in canvas

I want to rotate the arrow to any given angle. What i need to add/modify so that it can be rotated to any angle. Currently its on 180 degree. function drawArrowAtAngle(cx,cy,angle,context){ context.save(); context.beginPath(); context.lineWidth = 1; context.strokeStyle = '#aaa'; context.moveTo(cx+25,cx-2); context.lineTo(cx-...

Keep JavaScript files in HTML or in JS file - what is best?

Would the page load faster if I keep all my JavaScript files in a separate file say MyCode.js and reference that file? Or does it not really matter? Thanks in advanced! ...

help me in jquery learning in php

please give information about ajax,jquery,and javascript. i want to learn it.so from where i should start. i am working with codeigniter php framework. ...

How to clear dropdownlist contorl in Javascript

Please help how to clear dropdownlist control in Javascript ...

Preventing Links before jQuery is Loaded

Hi Guys, How can i prevent links on click event before jQuery is loaded? The reason is i have few links that make AJAX calls through jQuery ajax functions and if user click them before jQuery framework is loaded the browser cant trigger jQuery ajax function and will follow links href="..." Thanks. Edit: Can i use this? <head> ... <sc...

iphone/ipad large canvas vs small canvas + div animation

Since I dont have either of these devices handy to test, which method would be faster on an iphone/ipad? One large canvas (overlayed over a bg of the same size), that is cleared, and has new pixel data drawn to it each frame, at a certain position or A small canvas that updates each frame, contained in a div that is animated across a ...

Accessing Sqlite3 database using JavaScript

Hi all, I hope someone can help me here. I am developing two apps at the minute, one iPhone, one Mac. Both have maps, the iPhone one has standard map and the Mac one has an embedded webviw that displays the map using a webpage with JavaScript. What I would like to do is to take the core data sqlite3 database from the iphone app and re...

Add two variables using JavaScript

Hello, var a = 1; var b = 2; var c = a+b; c will show as 12; but I need 3 How do I do it using JavaScript? Thanks Jean ...

How remove the previous event?

Hello, tell me what I need to correct, to the repeated clicking on another cell TR previous events are deleted Full example $('table tbody tr').each(function() { $('table tr:even').addClass('even'); $(this).hover(function(){ $(this).toggleClass("active"); }); $(this).click(function(){ $(this).closest...

Any JavaScript or jQuery Method to Load JS files synchronously ?

I'm loading user control through jQuery in my asp.net page. User control contains JavaScript files, while loading the user control all my js load at one time which are dependent on each other and they tend to give error while all file load at one time. So I want that my JavaScript file to load synchronously one by one , as one file ge...

Problem in assigning js value to php variable

Hi there, How can i assign a javascript value to a php variable, This is what i want to do: <?php $pag = echo "<script language ='javascript'>var pn = document.getElementById('t').value; document.write(pn); </script>"; ?> But getting error as: Parse error: syntax error, unexpected T_ECHO or ...

Javascript Regular Expression fails every other time it is called

I am using the following Javascript to read strings out of a text file and process them with a regular expression while (!textFile.AtEndOfStream) { currLine = textFile.ReadLine(); match = re.exec(currLine); do stuff with match } The problem I have is that every other time re.exec is called it fails and returns null; so the...

Firing events between an iframe and it's parent using YUI

I have an iFrame that is firing an event that I want the parent page to pick up. Essentially the inverse of this question. I can pick up the event inside the iFrame, so I know it's firing, but nothing happens in the parent. I'm using YUI 3 so any answers based around this get a double-thumbs up, but all help is greatfully received. Tha...

How to hide server control in JavaScript

Dear All, I want to hide server control in JavaScript. I do not want to use "none". Are there any other ways to hide the control? ...

How to disable Cross Domain Restriction

I am providing web service which return data as JSON object. The problem is with Ajax, Ajax can't call cross domain url. Is it possible to disable it? ...

When debugging with firebug, no error

I declared global variable in js file which is filled after jquery.ajax call. Everything works fine when I put breakpoint to see if the global variable has its value with Firebug, I can see it, no problem. But when I remove breakpoint and try again, error with variable 'undefined' shows. I also tried to put result into hidden field and t...

How to remove square brackets in string using regex?

['abc','xyz'] – this string I want turn into abc,xyz using regex in javascript. I want to replace both open close square bracket & single quote with empty string ie "". ...

How to give a style to google map bubble with openInfoWindowTabsHtml?

Hi, I am using google map for my site. I have used the following code function addMarker(latitude , longitude, infoTabs) { if(typeof(iconImage) !== 'undefined') { var icon = new GIcon(); icon.image = iconImage; icon.iconSize = new GSize(35, 35); icon.iconAnchor = new GPoint(14, 35); icon.infoWindowAncho...