Hi
This is for a simple web-page assignment.
I have a few pages on which I would like to display the same list of links in a sidebar and so have made the following javascript:
document.getElementByid('list').innerHTML = '<a href=\"index.html\">Main Page</a>'+
'<a href=\"benefits.html\">Benefits</a>'+
'<a href=\"facts.html\">Shocking St...
I have a Javascript which is a little larger so I tried to show a .gif on the begin off the script and hide it after its finished. But if i do so the script runs and does all steps in one process so the picture is never shown. How can I force javascript to complete the show of the picture before run the rest of the script?
...
I want to be able to create and unknown number of objects. I'm not sure if there is a better way to manage and reference them.
Lets use a standard OOP example... say every time a user enters a name for a pet in a text field and clicks a button a new pet object is created via the petFactory function.
function pet(name)
{
this.nam...
I'm looking to sort an array of about 200-300 objects, sorting on a specific key and a given order (asc/desc). The order of results must be consistent and stable.
What would be the best algorithm to use, and could you provide an example of it's implementation in javascript?
Thanks!
...
What is the syntax for indexOf() to go through a multidimensional array?
For instance:
var x = [];
// do something
x.push([a,b]);
x.indexOf(a) // ??
I want to find 'a' and do something with 'b'. But it does not work... As this method should be iterative itself, I do not presume using any other iteration would be a good thing to do. C...
Hello,
I'm a PHP programmer...done some study on google and tried it, but didn't get the output i need
Users will enter the time in the textbox provided...now i need to give them counter from the time they entered ?
Example : If i enter 1:27:38 and click on submit
then time should get decreased and i shud get alert when it reaches to...
You know, the menu that pops up when you get to the site and you can click the 'x' to the right to remove it. What technology is this (I assume AJAX) and what terms do I need to search for to use this?
...
I'm using mootools-1.2.3 at the moment and I'm having trouble getting a variable to be accessible outside of a function.
I need to define the variable in the domready function, because otherwise the DOM hasn't been loaded and selector functions will not work (I can't place the script at the end of the HTML I don't have control of when t...
I have this line of code in javascript
var re = (http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?
Usually I encapsulate the regex syntax with the / characters but since they are found within the regex it screws up the encapsulation. Is there another way how I can store it inside the variable...
I have some code that looks like this:
<h3>Thursday Sep 10</h3>
<ul>great stuff in here</ul>
<h3>Friday Sep 18</h3>
<ul>other stuff in here</ul>
They have a basic jQuery hidey-showy thing happening: click on the H3, and the UL underneath expands or contracts. By default they are all showing/open.
I'd like to set it up so that any ...
I am creating firefox extension. I need to use sockets. I need it to work over http protocol. Is there any javascript library for creating http sockets. Communication is peer to peer so I need client socket and server socket in javascript it need to work over port 80 so it must follow http protocol.
...
If I put in the src attribute ./images/nothing.gif what does that translate to?
I have a javascript file that makes src attribute of some html element to 'nothing.gif'
but on the page nothing.gif shows as 'file not found' symbol.
Currently nothing.gif resides at the following place in my ftp server:
/www/foldername/wp-content/themes...
How do I link to snapshots of embedded flash videos instead of the actual flash videos to reduce loading times of a site?
...
I cant make the shadowbox work...I have a static html page which has an image that acts as a link to open a swf in the shadowbox.
however when I click on the image it opens the swf like any other image file in the browser.
The Shadow box doesn't seem to work at all.
This is my html page. I am using shadowbox-build-3.0b. Its strange that...
I'm looking for advice as to coding conventions. The primary languages I use, in order of frequency are C#, JavaScript, and ActionScript. They are all ECMA-based languages, so for the most part, the syntax is interchangeable. What I would like to do is standardize the way I write code.
I looked around for documents on coding standards a...
I have to move all my scripts into a separate .js file. But I have wired the code in the client (*.aspx) file, with code such as
<script>
var x=<%=ViewData["Key"];%>
</script>
I'm sure there will be an issue when I move that line to the js file as the server side context can't be accessed.
How do I solve this issue?
...
I'm getting a weird error where in Internet Explorer 7, when I call Math.round on a float it gives me an "Invalid Argument" error. Consider the following:
var elementLeft = parseInt(element.style.left); // Here we're actually getting NaN
function Foo(x) {
this.x = x;
this.apply = function(element) {
element.style.left = Math.ro...
By default if you specify a speed jquery adds a weird looking animation where it expands from the left end corner. I want it to just slide down. Is there a way to do that without importing something else like jquery UI ?
I'm looking something in the lines of :
$("test").show('slow', {animation:'slide'})
If there's no way, then what w...
Using a lightbox like ColorBox or jQuery Lightbox Plugin how can i make a single link which opens a gallery / array of images?
For example i have 1 thumbnail and when a user clicks it i want it to open multiple pictures in the lightbox so the user can click next or previous to view all the pictures within that gallery.
My thinking wa...
Hello, I want to minify my JavaScript files immediately in Gedit. I tried do it via external tools option with jsmin.js script. I have SpiderMonkey engine installed. I stored jsmin.js file at /home/mushex/use/js/jsmin.js and created a new js file named jsmin-low.js in the same directory with content
#!/usr/bin/js
load('/home/mushex/us...