Hi all.
Is it possible to delete some images from the browser (firefox2) memory using javascript? By doing this, I want to save some precious browser memory and let my web app to work better.
I guess that if possible, it will be something like this:
delete (document.images[7]);
document.images[7].src = null;
document.images[7] = null;
Thanks guys!
i am tracking the mouse movements of a user using javascript and storing it along with the browser resolution.
Then i can check the user mouse movement in my browser which is 1024 x 768 resolution.
But if the user is using a browser in 800 x 600 then the mouse movements are recorded wrt 800 x 600. And when i see the mouse movements in 1024 x 768 the mouse movements are wrong.
So how can i scale from 800 x 600 to 1024x 768?
Anyone have experience with game development using javascript and the html5 canvas element?
So far I have found two libraries, are either of these worth using?
http://tommysmind.com/ (XNA Port)
http://gamequery.onaluf.org/ (jquery plugin)
Does anyone have any other resources?
Hi everyone, I get a script from a website to put it into my website, but the font color is not what I want.
the script is:
< script language="javascript" src="http://www.parstools.net/calendar/?type=2"< /script
and now I want to change the font color of it, what should I do?
I would really appreciate your help, thanks.
Here is an interesting use of JavaScript: reordering items with drag and drop. The implementation itself in my page works fine, but is there a way to determine in which order the user put the items?
jQuery is undoubtedly the best javascript framework available and its plugin base is also pretty awesome. I wanted to know which one is the best framework in terms of
Use Of Plugin
API Design
Ease Of Use
Documentation
Support and Bug fixes
etc...
In my view the best plugins I used so far are
Form plugin
Validation
Nyromodal
jQuery drag&drop, Sortable
EDIT: Made it a community wiki
We have an rich client application running with dojo 1.2.x.
Sometimes users are pasting comments from their word 2007 into an textfield.This is an repeating source for errors with displaying this comments inside an an dojox.grid.
Is there any "javascript" way to stop users pasting from word?
I want to have a text field where people can type in a value. Then I want to have a href open a url with the text field appended to the end.
So if the text field says "elephant" then when they click the link, a page will open with at example.com/elephant.
I think javascript would be the easiest way to accomplish this but I just don't know how.
I am calling window.location.href = "some url";
I want to check whether that url is opening or not. Means if the url is wrong how do check it in javascript so that I can redirect it to another url.
Thanks.
I want to set label's value from popup.But label is in frame and I dont know how to achieve it from popup. From parent page,i get this label by following javascript function.
But when I use this function in popup page, I cant find topframe.Do u have any solution about how to success it?
if (window.parent.document.getElementById('lbl'))
{
window.parent.document.getElementById('lbl').innerText = sender.getSelectedItem().get_text();
}
else
{
window.parent.frames['topFrame'].document.getElementById('lbl').innerText = sender.getSelectedItem().get_text();
}
Following is the code which will clone a set of div with their events(onclick) which is working fine for FF but in case of IE it is not firing events associated with each div.
<html>
<head>
<style type='text/css'>
.firstdiv{
border:1px solid red;
}
</style>
<script language="JavaScript">
function show_tooltip(idx,condition,ev) {
alert(idx +"=="+condition+"=="+ev);
}
function createCloneNode () {
var cloneObj = document.getElementById("firstdiv").cloneNode(true);
document.getElementById("maindiv").appendChild(cloneObj);
}
function init(){
var mainDiv = document.createElement("div");
mainDiv.id = 'maindiv';
var firstDiv = document.createElement("div");
firstDiv.id ='firstdiv';
firstDiv.className ='firstdiv';
for(var j=0;j<4;j++) {
var summaryDiv = document.createElement("div");
summaryDiv.id = "sDiv"+j
summaryDiv.className ='summaryDiv';
summaryDiv.onmouseover = function() {this.setAttribute("style","text-decoration:underline;cursor:pointer;");}
summaryDiv.onmouseout = function() {this.setAttribute("style","text-decoration:none;");}
summaryDiv.setAttribute("onclick", "show_tooltip("+j+",'view_month',event)");
summaryDiv.innerHTML = 'Div'+j;
firstDiv.appendChild(summaryDiv);
}
mainDiv.appendChild(firstDiv);
var secondDiv = document.createElement("div");
var linkDiv = document.createElement("div");
linkDiv.innerHTML ='create clone of above element';
linkDiv.onclick = function() {
createCloneNode();
}
secondDiv.appendChild(linkDiv);
mainDiv.appendChild(secondDiv);
document.body.appendChild(mainDiv);
}
</script>
</head>
<body>
<script language="JavaScript">
init()
</script>
</body>
</html>
can anybody tell me whats the problem in above code please correct me..
I have a nascent bridge scoring app that is meant to be stored locally on an iPod touch/iPhone (iPad? Would probably be fugly...)
So far so good, got a custom icon rolling and basic JS navigation laid out, but my problem is that it retains its state when I quit the app. Is there a simple magic Apple meta tag for this? Or is it achieved with javascript?
Thanks for any insight.
var phoneBookTableValue = [];
phoneBookTableValue.push({ "key":"1", "value":["3396,Accounting ,CCH,,,,","1"]});
phoneBookTableValue.push({ "key":"2", "value":["3284,Acute Care ,CCH,,,,","2"]});
phoneBookTableValue.push({ "key":"3", "value":["3265,Acute'Care East ,CCH,,,,","3"]});
When running the javascript file I get the error "missing ] after element list. Can U help me? PLZ!
Facebook has a "Dom Placeholder" on their Password field when logging on. When I click on the input for the password, the placeholder disappears and allows me to type my password "masked".
Is this Javascript related and how would I go on replicating this script?
This seems like a pretty natural use case to me, though I haven't been able to find anything on it:
Say I have a fixed-width div that is dynamically populated with some number. What's the best way to ensure that numbers with more digits take smaller font sizes such that they fit nicely into that fixed width? Is there some CSS property for this, or do I have to resort to Javascript hackage?
I recently transferred a site to a new host. Reloaded everything, and the javascript that worked fine before is breaking at an element it can't find. $('#emailForm') is not defined.
Now, the #emailform isn't on the page, but it wasn't before either, and JS used to skip this and it would just work. Not sure why this is happening. Any clues?
Assuming my conditions for building a RSS feed reader were I had to provide only a Javascript snippet. The RSS is cross domain and is only XML. What are my options and how can I implement them? thanks
I correctly inserted a javascript file into the wordPress admin with :
wp_enqueue_script()
I know that the script is loading. I tested it with an alert().
I then found that I am unable to access the DOM. When I tried :
document.getElementsByTagName('body')[0].addEventListener('load', function() {});
This error was:
Uncaught TypeError: Cannot call method 'addEventListener' of undefined
This is the first time I have used 'settings api' or inserted scripts into the WordPress admin.
Hello everybody,
When my website is in fullscreen mode (with IE8), the window.focus() javascript command doesn' work.
Do you have a fix for my problem?
I tried to put a window.blur() before, without success.
Thank you!
Nicolas
I have a piece of html/javascript written in jQuery at http://pastebin.com/MzMPjtvF
My issue is the divs with images in them will only show up until $('.platform').hide() is ran, to the point that those divs won't even show up in $('.platform'). I'm not sure if its a bug or my lack of knowledge of jQuery
I've tried a few different things but nothing really worked, basically i need to get the current location/url from the iframe, get the part i want and return it to the hash in the url. how can i do this in javascript?
I'm using CSS 3 features like "rounded corner" or "shadow box".
IMHO These are fantastic features for people like me with no graphics knowledge. But, i've noticed, IE 7-8 not support CSS 3.
So i'm asking you: is there a way to "enable" some features maybe with some javascript functions to include in my html file ?
Thank you!