I've seen object literal examples and they look really nice and sensible. What I want to know is if it's possible to use object literal over multiple files, because all the examples I've seen had only 1 file.
Thanks.
...
in Firefox I used the document.onclick event and then checked if it was a right click, and If i right clicked everything went as expected. But in Chrome, Opera and IE8, if I right click the document.onclick doesn't fire.
I want to have a custom context menu for img elements. How do I go about this?
...
Hello,
it's my 1st question here, so pardon if something is asked wrong :)
I want to preload 3 images before webpage is loaded so all of them would appear in the same moment. Right now images are loaded one after another and it looks kinda choppy. One image is defined in css (), other two are plain simple "img" element. I've tried crea...
I'm trying to implement simpleCartjs, and I'm having issues with quantities. The products are sold by weight, so I'm trying to add something like 1.5 tons to the cart. However, when I pass something with a decimal like that, the cart ignores it and adds the whole number portion, but not the decimal. For example, 1.5 becomes 1, and .5 ret...
I have a HTML canvas element which is resized when the user resizes the screen.
canvas.height = pageHeight();
canvas.width = pageWidth();
The actual resizing works fine, but it blanks the canvas.
I would like to keep the contents. Is there another method of changing the size of a canvas element, or is there a way to store the content...
Hello, i am using YUI 3.1 Library from Yahoo and also the TextExpander to let a TextArea to grow up when a user type.
The code below initialize the TextArea:
YUI({gallery: 'gallery-2010.03.23-17-54'
}).use("node", 'gallery-text-expander', function(Y) {
Y.one('#myTextArea').plug(Y.TextExpander);
});
It's work perfectly but now...
Hello,
I have some issue here connected to removing the marker, when I'm just dragging it out of the map.
Here what do I have:
google.maps.event.addListener(marker, 'drag', function(event) {
google.maps.event.addListenerOnce(map, 'mouseout', function(event) {
marker.setMap(null);
});
});
I don't know why, but it doesn't work...
I've been fooling around with a very minimalistic jquery admin area menu. The thing is I want jQuery to build 3 equal menus with different ID's. I managed to do this by creating a function and call it 3 times with different variables, but I'd like to ask my first question on this lovely community:
What is the most minimalistic and effic...
I am wondering if it is possible to create a closure in ActionScript2 like it is possible in Javascript.
This doesn't work:
var util = function(){
var init = function(){
trace(this + ': util'); // i want to know this thing works!
var myUtils = new MyAS2Utils(); // load some stuff
var url = myUtils.getURLInSomeReall...
I'm having some difficulties getting the script below to work with my text editor. I'm not sure what is wrong but selectionStart and selectionEnd are returning as undefined.
Its suppose to get highlighted text in an editable iframe and then replace it.
var textarea = document.getElementById('editor').contentWindow.document.body.innerH...
I am trying to grab some data via JSONP. Using Firebug, I am able to see the data properly being returned, but I am having a hard time thinking how I have to parse it. The data return is really a nested array correct? someFunction is the name of the callback function. This is how the data looks:
someFunction([
{
"title":"Sa...
I'm doing my first project with jquery:
My site will have some tabs:
1. I've got a list which will be the tabbar.
2. I've got a lot of content-container-divs which I hide() / show() depending on which tab I clicked.
My question/s:
Should I load() unload these divs, even if they are in the same html ?
(on jquery-docs they load from ex...
I am looking to create a variable that is a template for repatative elements of my site. I however am only using it infrequently so I do not wish to use a javascript templating engine or library.
I am using jquery... if that effects anyones approach.
This is one of my templates.
$html_template = json_encode("
var html = '<a href=\"jav...
I am having a problem checking if a file exists using $.ajax(). I am looping through a json file with $.each and I want to see if the specified staff member has an image, and if not use the no_photo.jpg image. I keep getting the no_photo.jpg image even though there is the staff member's image in the directory.
Here is the entire $.getJS...
Hey everyone,
This is my first post on StackOverflow. This community has provided me with some great insights into lots of different coding questions over the years. So since I've been stuck on this particular task in JS for days, I decided I'd lean on this great community and see what sort of help I could get on my question.
I saw a...
I have been using this:
function FB_wait() {
if (typeof FB == 'undefined') {
window.setTimeout(FB_wait, 100);
} else {
more();
}
}
But there must be a better way
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $conf['fb']['appid']; ?>',
status : true, // check login status...
Hello,
I am trying to execute a loop with a JSON query inside it. My code looks something like:
for (var i = 0; i < numitems; i++) {
var currentitem = items[i];
$.getJSON("http://localhost/items.php", {'itemname' : currentitem},
function (json) {
alert (json);
});
}
But it seems like the for loop doesn't wait for th...
I have a small progressive disclosure ("text expand and collapse") but the toggle text doesn't change. Works like this: ( and I didn't write it)
$(document).ready(function() {
$('div.view').hide();
$('div.slide').toggle(
function() {
$(this).siblings('div.view').fadeIn('slow');
},
function() ...
I am writing an app for the iphone that fetches weather information based on location. The weather feed works fine for a set location. I have created a parser that fetches gps coordinates based on a programmed called instamapper which posts coordinates online in csv format. I can execute the code fine in IE within a HTML file and see my ...
I have no experience working with Google Maps, but I'd like to embed a "Choose your county" map in my webapp. My app only targets California, so it only needs to support one state, but I can't find any easy way to do this (without manually drawing overlay polygons for all the county lines).
I assumed I'd easily be able to find examples ...