javascript

Using multiple Javascript frameworks in a project?

Is it good or okay to have several frameworks in a project, or is it bad because it gets cluttered (= a mess), and the loading times maybe get's longer. Does some 100 K matter really? Or should you stick with one? ...

Variables behaving badly - in javascript - in functions

First off, here's my code: var variable1 = 10; function f1 (){ alert(variable1); } //When button is pressed, call function $("#button").click(f1); Why can I not access variable1 inside the function? Many thanks and a Happy Christmas. Modified question $(document).ready(function() { var how_many_words = 3; alert(how_many_words...

Accessing Current Tab DOM Object from "popup.html"?

I'm developing an extension for Google Chrome browser. I could not figure out how to access the current tab DOM object from the "popup.html" page. any suggestions? ...

simple script question - javascript

Hi There I have a simple question how do I get a Request.Form within a script tag ? <script language="javascript" type="text/javascript"> var sLandingPage = ""; var sInitContent = ""+Request.Form("textarea")+""; var sInitDialogMsg = ""; any help would be appreciated ...

Another "is ASP.NET MVC right for me?" question

Here's my particular situation... I have a decent amount of experience with webforms, and I must say, a lot of it has been pretty frustrating. I like that there are lots of built-in controls, but then I discover that they don't quite do what I want, out of the box. I end up rolling my own controls (that inherit from the built-in control...

Clarification about Javascript objects inserted into DOM?

I am working on a personal project involving some jQuery / native Javascript programming. I am hoping somebody can clarify an issue I'm seeing with my code. I'm confused about the relationship among objects created in Javascript and objects that are part of the DOM. When using JQuery UI (the tabs feature), my program behaves differe...

Get function caller scope

Is it possible to extract a functions caller scope? I have this example: var myObject = { id: 1, printId: function() { var myId = function() { return this.id; } console.log(myId()); } } myObject.printId(); // prints 'undefined' The example above prints out undefined, because 'this' see...

how to set to call a function from the current object using settimer

function Something() { this.var1 = 0; this.var2 = 2; this.mytimer; this.getCars=function() { //some code }; this.start = function(l) { this.updateTimer=setInterval("this.getCars();" , 5000); }; } var smth = new Something(); smth.start(); When I type in this.getCars() it does not work. if the function is global de...

jquery stops insert into database

Hello all, i have made this script but then i press submit the jquery animation start but it will not submit it into the database with PHP :S. Here is my script http://pastebin.org/68943 Thanks ...

how to delete cookies in firefox 3.5+ using an extension?

hi everyone. i've got a problem: i need my extension for firefox 3.5+ to delete cookies. all cookies of my firefox. example: i've serfed net, got some cookies installed on my pc by the sites i've visited. and i want my extension for ff to delete all these cookies. could u please show me the direction where i can find an answer for my que...

disable submit button when javascript is disabled

I have a form which needs javascript to be enabled for validation, is there a way to disable submit button when javascript is disabled and warn user to enable it first ? ...

How to rewrite this Javascript code using Jquery?

function SelectDistrict(argument) { var sel=document.getElementById("city"); sel.style.display = ''; sel.options.length = 0; sel.options.add(new Option('Please select a location','')); var i=1; var tempInt=parseInt(argument); if (tempInt%10000==0) { var place1=document.getElementById('place1'); place1.innerHTML =county[tempInt]; } s...

Why some javascript error only comes in IE not in firefox? how to know where is code creating problem?

Why some javascript error only comes in IE not in firefox? should i solve all IE javascript errors, if my site is working fine with it ? ...

Can the Google Maps API javascript be cached?

Just curious, whether the Google Maps API v3 javascript be cached on the local server? Because, sometimes my intranet pages are loading slow because of slower internet connection. Otherwise, it would load the file from local server and slow down only when the map request is made. I am even ready to run a cron job to update the javascri...

Detecting Firefox extension version.

I have a Firefox Extension that I would like to populate the About box with the version within install.rdf. I know that FUEL's extIExtension allows one to see the version for an extension but I did not create the extension using FUEL (and the docs on MDC seem very light on how to transition to it). Is there a way to dynamically check th...

prevent window for scrolling after div box scrolling

Hello, I have a small div box that has a vertical scroll bar and sits within an html page that also has a vertical scroll bar. My problem is when the user reaches the end of the small DIV box scrolling, the ENTIRE html page that contains the div box then begins to scroll (assuming the user is scrolling via the mouse scroll and NOT by ac...

How can I chain click events with Mootools so that they execute in order?

I have a series of buttons that fire the list function when they are clicked. The list function itself contains an AJAX request and a bunch of other stuff before and after which loads in a separate section of the page. var list = function() { } $$('.buttons').addEvent('click', list); Everything works fine if I wait for list to complet...

JavaScript problem?

Now when I have a user cast a vote the script updates my database but it won't display the following code below to tell the user its vote has been excepted everything else works correctly except my AJAX code. How can I fix this problem to get the below code to display the new rating when user enters his or her vote? I'm using PHP Here...

how to register an element onload when the element is not loaded?

i've learned that you can register body onload like this: window.addEventListener('load', function, capture); // or attachEvent for ie; capture is true or false so i tried to register an element onload like this: document.getElementById(eleid).addEventListener('load', function, capture); but it gets me error, says "can not call met...

Does the JavaScript manager implementation exist for ASP.NET MVC?

I'm going to implement the load on demand technics for JavaScript code in ASP.NET MVC. Could you advice me the existing solutions and schemes for the platform? I've found the post about this subject in KAZI MANZUR RASHID'S blog What are the best practices for this task? ...