Search javascript

100725 results
3

votes
1

answer

JavaScript debugger in JavaScript

I am looking for a JavaScript JavaScript debugger. The situation is as follows: I am making a JS game engine. The AI scripts as well as various other actions are implemented in JS. It is possible, from the engine's developer mode, to edit this code from the browser itself (using Ace). Now I want to...
MasterScrat
1

votes
1

answer

javascript, Javascript bug

Run in console next code setTimeout(function(){ console.log(1); }, 2); console.log(2); setTimeout(function(){ console.log(3); }, 1); Why 4 values when has only 3? console
bzenkobogdan
4

votes
1

answer

Dynamically load JavaScript with JavaScript

After over an hour of trying to get it to work I'm thinking it's because of cross domain policies, but I really thought this would work. I can't find a lot of info on it either. But, here is my issue. I have a site called http://mysite.com and then I include a 3rd party script (what im writing) and...
Oscar Godson
2

votes
4

answer

Dynamically insert javascript using Javascript?

I am trying to dynamically insert a set of script tags with some javascript code in it using javascript. I am basically trying to wrap a file in jwplayer, but the script string is breaking rest of the javascript code in the page. How do I do this correctly? the line causing the problem: $file_link_i...
user794846
4

votes
1

answer

JavaScript preloader of more JavaScript

I've seen a few tutorials on how to create a JavaScript preloader for images. Is it possible to use a JavaScript preloader for other JavaScript? My website uses mootools (and others too) for animations and a copious amount of pictures, etc -- therefore it takes awhile to load. Is it possible for t...
captainandcoke
1

votes
2

answer

Properly formatting JavaScript in JavaScript

How can I automatically format JavaScript properly? As an example, this: (function(){(function(){alert('whatever')})()})() Should become: (function(){ (function(){ alert('whatever') })() })()
Tanner Ottinger
1

votes
1

answer

Javascript in HAML in Javascript

I've got a question that mightve been asked before but i have trouble finding a proper description. I hope someone can help me out. In the code below on the line where i set var price i want to add the javascript variable accu_id to find a record in my DB through rails. How do I do this in embedded...
Daniel B
0

votes
3

answer

Javascript function in Eloquent Javascript

How does greaterThanTen(9) become the y variable in the return function? What I mean is how does the parameter (9) become the y in the return function argument? Wouldn't 9 be replaced with x since greaterThanTen = greaterThan(10)? Wouldn't the 9 just replace the x = 10 parameter? I just don't unders...
Vodka_Tonic
3

votes
1

answer

Remove unnecessary JavaScript using JavaScript

I've a page in an ASP.net site where i've multiple content placeholders, script tags with JavaScript functions and others elements. I'm hiding all content holders and other html elements using JavaScript except a div which i want to display. But i get the other scripts running in that page. How can...
NLV
67

votes
9

answer

JavaScript parser in JavaScript [closed]

I need to add some lightweight syntactic sugar to JavaScript source code, and process it using a JavaScript-based build system. Are there any open source JavaScript parsers written in JavaScript? And are they reasonably fast when run on top of V8 or a similar high-performance JavaScript implementati...
emk
4

votes
4

answer

JavaScript: mouseenter event in JavaScript?

Is there a mouse enter event in javascript(only JavaScript, no jQuery to be used, please)? When I do this, it gives no response. window.onload = initAll; function initAll(){ if(window.addEventListener){ document.getElementById('container').addEventListener( 'mouseenter', freeze , false); } } functio...
Navneet Saini
2

votes
3

answer

JavaScript syntax check with JavaScript?

How could a Commando like me check if inputed code is a valid JavaScript source using some JavaScript built-in methods (if any!) or in any other possible way!? (Something like a preparser found in various IDE's like NetBeans, Eclipse, etc)? I have to check if code is OKAY and then window.eval()-it t...
3

votes
2

answer

Alert Javascript Errors when javascript fails?

When I have a fatal error in javascript making the app not usable, like this one: SyntaxError: Unexpected token '}' Is it possible to catch it and display it somehow? like replacing the body or alerting? So in other words, a way to run javascript code if there is a javascript code error... I can't o...
Vincent Duprez
3

votes
6

answer

Real Time Javascript Event Tracking (Javascript Stats)

There are lots of real time web stats services on the web (w3counter-histats-gostats).They just count once when page is requested , But what I want to do is track javascript functions/events, because my website is fully-ajax.So I want something like google analytic's event tracker (http://code.googl...
Oguz Bilgic
4

votes
2

answer

Writing a javascript file from another javascript

I have two web pages. On the first page I have to submit a form. Using the values from the form (using embedded javascript), I need to generate another javascript file and use this generated javascript file in the next page. How can this be done? Or is there a better way of doing this?
Ankur Ankan
2

votes
2

answer

Load JavaScript file inside another JavaScript file

I'm using node.js and socket.io and doing a server/client thing. On my Server, is since its' not on a webpage, is there a way I can load the latest file (or latest jQuery?) so I can use jQuery functions inside my Server js file. Thanks
nn2
3

votes
2

answer

Import JavaScript file from within JavaScript synchronously?

Instead of messing up my HTML file, I'd like to import my external JavaScript files through another JavaScript file, much like @import in css. On several websites, including StackOverflow itself, I noticed that appending a script tag to the DOM can solve this issue; however, this is done asynchronuo...
pimvdb
3

votes
3

answer

Difference between application/javascript and text/javascript

I was reading a tutorial on HTML 5 Canvas Animation with javascript (of course). In the header, the author used application/javascript which is rather new to me because I've only seen text/javascript used. Can anyone help? There is every likelihood this question has been asked before but I'm using a...
afaolek
3

votes
4

answer

Insert javascript into javascript html return

I've got an HTML table that's being returned using javascript return function. It works perfectly until I try to add an additional if clause into the middle of it. function format ( d ) { return ''+ ''+ ''+ 'Save'+ ''+ ''+ 'Customer'+ ''+d.customer+''+ 'Value'+ if (d.country !== "usd") { ''+d.v...
Brian Powell
3

votes
2

answer

JavaScript vs No JavaScript links and forms

A few days ago I posted this question: My last question about ajax link vs normal link It was about making links work for JavaScript enable browser (AJAX) and normal link for non-JavaScript browsers or crawlers. Now I found that this method work for me and is also recommended by Google. This is what...
MadeInDreams
3

votes
1

answer

Javascript Regex for Javascript Regex and Digits

The title might seem a bit recursive, and indeed it is. I am working on a Javascript which can highlight/color Javascript code displayed in HTML. Thus, in the Internet Browser, comments will be turned green, definitions (for, if, while, etc.) will be turned a dark blue and italic, numbers will be re...
Kafoso
2

votes
2

answer

Moving inline Javascript to External Combined Javascript

Hi There I am busy moving all my inline javascripts to a combined.js file. In my header I have the code below. I am working in wordpress. The code below makes a slider function on my page. I have already moved the bulk part of the javascript to a combined js file. (function($){jssor_slider1_starter...
Gerald Ferreira
2

votes
4

answer

JavaScript Array Initialisation in Simple JavaScript Inheritance

I'm currently working on some code based on John Resig -Simple JavaScript Inheritance. And i'm having some trouble with the initialization of arrays. If i put an array as an attribute for an object and don't initialize the array during the call of init(), all the modification made to the array like...
Py.
1

votes
4

answer

Javascript and performance, use jQuery or Javascript?

I have a big data should be shown in a Table. I use javascript to fill the table instead of priting in HTML. Here is a sample data I use: var aUsersData = [[1, "John Smith", "...."],[...],.......]; the problem is that Firefox warns me that "There is a heavy script running, should i continue or stop?...
Alexar
2

votes
2

answer

Show javascript Alert without blocking javascript

On page load, I am starting a timer to check if session is expired. I am checking expiry by making ajax call to a page. I need to display alert 5 minutes before expiry and redirect to default page after expiry. Here is my code: function startSessionCheckTimer() { setInterval(checkSessionExpiry, 6000...
Tushar Kesare
33

votes
6

answer

Is it JavaScript or Javascript? [closed]

I know this isn't programming-related, but I'm curious what this community thinks about the subject. My understanding is that JavaScript is what the language is named. Lately, it seems to have become trendy to write it Javascript. Who are we to rename the language? I'm interested to hear if there is...
Andrew Hedges
1

votes
2

answer

JavaScript script tag in a JavaScript String

I have the same issue as here: Script tag in JavaScript string However I can not resolve the issue with the proposed solutions. I'm using datatables plugin for jquery. I tried different solutions from above thread but none work. I get a "$ is not defined" error.If I set var html to like "test" it wo...
beginner_
1

votes
4

answer

Execute local Javascript after remote javascript loads?

I have a page where I am using jquery/ajax to pull down a chunk of HTML/JS from another component and injecting it into the page. That HTML references additional JS files, and I need those referenced JS files to be loaded before I run my javascript. The HTML/JS that is being injected looks somethin...
Mike Mooney
2

votes
2

answer

Javascript: what is this javascript feature

I'm reading a react sample project. Here is the reducer code: export const COUNTER_INCREMENT = 'COUNTER_INCREMENT'; export const COUNTER_DOUBLE_ASYNC = 'COUNTER_DOUBLE_ASYNC'; // ------------------------------------ // Action Handlers // ------------------------------------ const ACTION_HANDLERS = {...
15

votes
7

answer

Lazy loading JavaScript and Inline JavaScript

I noticed in the of my site (for work), there are a lot of and tags. There are even more JavaScript/CSS files that are only loaded for specific pages (we're using CodeIgniter, and the file paths are passed to the header view). I was considering using a conditional/asynchronous loader (eg. yepnop...
Rocket Hazmat
36

votes
1

answer

text/javascript vs application/javascript [duplicate]

This question already has an answer here: What is the javascript MIME type for the type attribute of a script tag? [duplicate] 5 answers I am curious about the semantics of the MIME types application/javascript versus text/javascript. Obviously, one is supposed to be executed, and the other is su...
sircapsalot
266

votes
5

answer

Javascript .map files - javascript source maps

Recently I have seen files with .js.map extension shipped with some JavaScript libraries (like Angular), and that just raised few questions in my head: What is it for? Why do the guys at Angular care to deliver a .js.map file? How can I (as a JavaScript developer) use the angular.min.js.map file? Sh...
Muhammad Reda
2

votes
1

answer

Page JavaScript calling a Firefox extensions JavaScript

My Firefox extension has a button which when clicked, injects some JavaScript code into the current page. How can this injected JavaScript code in a web-page call a JavaScript function in my extension? It would be helpful if someone could point me to an example. Thanks.
Mridang Agarwalla
2

votes
1

answer

Convert javascript template to pure javascript

By using java i want to convert javascript template (i try to make ) to pure javascript Here is example : Input output pure js example out.print(""); function test() { return "Just a message"; } out.print(""); if("a"=="b") { out.print(test()); } out.print(""); out.print(""); I need a function to...
user1942648
7

votes
4

answer

Javascript IOS5 “JavaScript execution exceeded timeout”

the following test is basically ~1000 math operations and works fine on most PC and android browsers, and iOS 4.x. On iOS5 safari (iPhone 4 and iPad 2) we get "JavaScript: Error undefined JavaScript execution exceeded timeout". Any help greatly appreciated thanks. /** Converts numeric degrees to...
ajayel
2

votes
1

answer

JavaScript disappears after using 'Back' / JavaScript postponing

I've been working on some JavaScript for a little while, and one of the most frustrating things so far is that it seems my JavaScript is refusing to load if Back, Forward or Hard Refresh are used. Considering my website is built on static HTML pages generated repeatedly through a MySQL database conn...
user1649077
2

votes
1

answer

Replace Javascript hyperlink with Javascript button

I'm a newby here. Just cutting my teeth with Javascript. I've spent a long time today going through every forum I can trying to find a solution to this. I'm finding it fun learning this stuff! Anyways, I'm working with the following script that does a call-to-action link with jw player... Call to Ac...
George W
34

votes
4

answer

Add JavaScript object to JavaScript object

I'd like to have JavaScript objects within another JavaScript object as such: Issues: - {"ID" : "1", "Name" : "Missing Documentation", "Notes" : "Issue1 Notes"} - {"ID" : "2", "Name" : "Software Bug", "Notes" : "Issue2 Notes, blah, blah"} - {"ID" : "2", "Name" : "System Not Ready", "Notes" : "Issue3...
MegaMatt
3

votes
0

answer

nXhtml (No javascript-mode/eruby-javascript)

I've just installed nXhtml by downloading their zip file, extracting the archive into my home directory and adding (load "/home/spinlock/nxhtml/autostart.el") to my .emacs file. My problem is that when I try to edit a .js.erb file, I'm getting the error: (No javascript-mode/eruby-javascript) and I'm...
spinlock
11

votes
2

answer

language=“javascript” vs. type=“text/javascript”

For adding JavaScript to HTML, I have seen people use and It doesn’t seem like whether the script is embedded or external influences this decision. Which one is preferred and why?
Foo