What is the best lightweight way to randomly show inline images from a folder on each refresh or on load a page ? using jQuery.
like jQuery version of this http://javascript.internet.com/miscellaneous/random-image.html
Update: 24 April
This is exactly what i want i just need unobtrusive jQuery version of this
<div class=”me-box”>
<...
Am I writing the correct switch case?
var cnt = $("#div1 p").length;
alert(cnt);
switch (cnt) {
case (cnt >= 10 && cnt <= 20):
alert('10');
break;
case (cnt >= 21 && cnt <= 30):
alert('21');
...
How do I do the following pseudo code in JQuery?
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#divToSlide").slideToggle("fast");
if ($(this).isToggled) { // <---- DOESN'T WORK -------
// do something when toggled
} else {
// do something different when not toggle...
I need to convert string in UTF-8 to byte array in 1251 codepage in JavaScript. Google says nothing useful. Help :)
EDIT: What is it for.
We have server and client. Server has userpasswords hased with SHA512 and 1251 codepage. Client (web browser) has to hash passwords (provided by user in plain text) with SHA512 and transmit it to t...
How do I use the JQuery delay in conjunction with my own defined function, pseudo-code like so?:
$('#foo').slideUp(300).delay(800).myOwnFunction(1,2,3);
function myOwnFunction (a,b,c) {...}
The code above doesn't work, however - per the JQuery documentation it appears like it should.
...
Okay - this is the dumbest glitch I have seen in a while:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type='text/javascript'>
var data = "</script>";
</script>
</head>
<body>
This...
I came across this great JQuery example of using a slidetoggle.
I want to implement it exact as is, except for one thing.
The example uses an image for the Up and Down (white) arrow indicator.
Can't I use the HTML ascii up arrow () and down arrow () instead of using an image.
If so, how?
...
My website doesn't use Flash or any plugins; just javascript (jQuery, Google Maps). It doesn't crash FF 3.6 all the time, but it usually does after a few minutes. It can happen on lots of different pages. Sometimes it crashes when I'm scrolling the page, sometimes when I'm interacting with a control.
Where do I even start debugging? Sho...
I have opened a new window with JavaScript:
var newwin = window.open('','preview','width=600,height=500');
Now I want to write some JavaScript to the window:
newwin.document.write("<script type='text/javascript'>alert('Hi!');<" + "/script>");
newwin.document.close();
However, the script never gets executed. Am I doing something wro...
i want to know main difference between
setInterval
vs
setTimeout
in javascript?
...
We are trying to install:
http://www.activecampaign.com/activespell/
But are getting this JS error:
[CPAINT Error] invalid HTTP response code '404'
It seems the ajax is unable to access something, but not sure what or why, anyone experienced this problem before?
...
I have a simple div element that contains another div element which contains 2 inline tags. I've associated an onmouseout event to the first div container and an onmouseover event to the second container.
The problem is that the onmouseout event is fired when the user hovers their mouse between the two tags in the div and also after ...
Given two DOM elements, say a and b, how can we determine which comes first in the document?
I'm implementing drag and drop for a set of elements. And the elements can be selected in any order, but when they are dragged, these elements need to be moved in the "correct" order.
...
As far as i can see in a situation like this:
var x = [];
var y = {};
y.someProp='asd';
This doesnt work:
x.push(y);
What I want to do is add a reference of y to x so that later if I will "delete y;" I want it also to be removed from the array x.
...
I am developing with app engine SDK. I have a feeling this is much too basic a question so apologies ahead of time...
A simple submit button doesnt work instead of just showing an alert box as expected it continues on afterwards and redirects me to the latest http-request, and I think this is because I dont understand how to tell the br...
<%= Ajax.ActionLink("Edit", "Update", "Home", new { id = item.mID }, new AjaxOptions { OnBegin = "function(){ $('#edit" + item.mID + "').show();}", HttpMethod = "get", UpdateTargetId = "edit" + item.mID })%>
The above code generates the html source code. when user click the link, it works well. But there're so many links there, I must ...
Hi all,
Edited:
Sorry for the inconvenience, when i look back the codes, it does not actually upload the files, it's only capture the file's info and store in the database, which later cannot be download by user coz there not exist such file anywhere... my questions is, how can i integrate this codes with move_uploaded_file() function?...
I am trying to make a javascript function (although jquery is perfectly OK) that will return a number that corresponds to the number of checkboxes checked in a form. Seems simple enough but I can't figure out a good way of doing it.
Thanks.
...
Hi, it's my first time using webflows in Grails and I can't seem to solve this.
I have 3 domain classes with associations that look something like this:
class A {
...
static hasMany = [ b : B ]
...
}
class B {
...
static belongsTo = [ a : A ]
static hasMany = [ c : C ]
...
}
class C {
...
static belongsTo = [ b : B ...
We have a html page being rendered in the browser (IE) that causes the browser to hang. The page is generated through server side script (ASP.NET and viewstate is disabled). The page while loading takes a long time (its not a b\w issue since we can reproduce it on local machine) and sometimes results in script unresponsive error. On deb...