|
function SetStateForNtimes(n) {
var popState = "?tabid=" + querySt("tabid");
for (i = 0; i <= n; i++) {
History.pushState({ state: 2, rand: Math.random() }, "RailEurope", popState);
}
}
function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i = 0; i < gy.length; i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
}
Click here for more detail (History.js)
I have used somthing like above. It works like facebook has implemented.
Called this on ready state.
window.setTimeout("SetStateForNtimes(20)",2000);
Hope It will help.
Thank You,
Anjum Rizwi
|
|
|
|
|
Reloaded for which one..? Clarify your Question...
Vinod Kumar B C
Software Engineer
|
|
|
|
|
Use history.back(0);
this should give you what you want...
|
|
|
|
|
i want to set random image in my asp.net website.. how can i do this , can any helps me to find out this bro/
|
|
|
|
|
khiladi786 wrote: set random image in my asp.net website
Based on the forum picked, it looks like you are looking for a image slider or viewer that shows images randomly. If so, (even if not), the logic is to have a set of images and number them. Pick random number within the range 0 to total image count. Based on the number show that image. You can have a trigger of button or a timer to pick random numbers at intervals when needed.
|
|
|
|
|
i tried but it not working ...can u provide me code ?
|
|
|
|
|
And what did you try and what was not working?
|
|
|
|
|
Hi,
I want to generate random numbers in js from specific set of numbers iteratively e.g:
generate random numbers from array of (2,3,4) excluding 1 and next time from (1,3,4) excluding 2 like that. I have used Math.floor and Math.random()but they generate the numbers from given range like(1 to 4). What if i want to exclude any number or want to generate number from given specific set of numbers??
|
|
|
|
|
aeman wrote: want to generate number from given specific set of numbers
What's the problem with generating random number within a range, see if the random number is not the one you want and then re-get the random number in case it's the one you wanted to avoid?
Example;
Random number between 1 to 4.
You wanted one of (1,3,4)
If random number returned is 2, ignore and re-get it.
Define a method that takes range start, end and exclude number:
function getRandom(rangeStart, rangeEnd, excludeNo)
{
var ranNo = GetRandom(rangeStart, rangeEnd);
if(ranNo == excludeNo)
getRandom(rangeStart, rangeEnd, excludeNo);
return ranNo;
}
|
|
|
|
|
Using your example, I would generate a random number between 0 and 2. Then use the result as an index to your three element array.
|
|
|
|
|
If you need to use this often for arrays, I would add a function to the array prototype:
Array.prototype.randomPick = function(){
var M = this.length-1;
var N = 0;
var randomIndex = Math.floor(Math.random()*(1+M-N))+N;
return this[randomIndex];
};
Then you can call it:
var arr = [2,3,4,5,4,6,8,9,7];
alert(arr.randomPick());
________
John Y.
Developer
|
|
|
|
|
hi
how can i access info popup page from main page?
|
|
|
|
|
|
Explanation is not enough..
|
|
|
|
|
hi guys
i want popup web page and i want redirect the popup page
by main page please help me
for example when user inter the home page popup new page
and how can access info popup page in the home page
|
|
|
|
|
use window.open in js like:
window.open(url,'name','height=popupheight,width=popup width');
|
|
|
|
|
|
I've run into a rather interesting, and frustrating bug that I'm hoping someone has some experience with or can help me work around.
Here's the scenario, and I've also set up a fiddle to show it [^]
I have a div with data-location="1"
If I move this div like this
$("#myDiv").appendTo("#someOtherDiv");
and then change the data-location value
$("#myDiv").data("location", "newValue");
I can no longer find the element using the data-location attribute.
This returns 0
$("[data-location='newValue']").length;
This returns 1
$("[data-location='oldValue']").length;
BUT, this returns newValue
$("#myDiv").data("location");
Has anyone ever run into this? Am I missing something here, or doing something wrong?
[EDIT: has some trouble with the fiddle, the link works now.]
[EDIT: SOLVED]
Apparently the .data in jquery only reads the attributes once and never sets the attributes. If you want to set data- attributes and recall them in your code you have to use the .attr() call.
modified 28-Dec-12 10:51am.
|
|
|
|
|
some browser do not support css property that time how to short out .
|
|
|
|
|
First: Wrong forum, this isn't Javascript
Second: Please give problem code and a description of what is going wrong. The post is almost as vague as "I have a problem with css, how do I fix it?" which tells us almost nothing.
Third: Welcome to web programming. When I started in 2000, no browser complied to the standard. Fast forward 13 years, and still we have variances even if things are vastly better now.
I suggest you read the post at the top of the forum, it gives guidance about how to ask a question.
|
|
|
|
|
i designed aspx page by using css run in googlecrome after finish my task i tried to IE9 than some visualization different but how to sortout these types of probles.Pls help me.
Thanks
|
|
|
|
|
SINNAM wrote: ow to sortout these types of probles
Have two CSS stylesheets - one for Chrome and one for IE. Based on the browser, load the appropriate CSS.
|
|
|
|
|
Can anyone please provide me complete steps and javascript code for FB connect for an asp.net web application project. I searched google ,but Icould not able to understand properly. Please provide the clear steps. Thanks in advance....
|
|
|
|
|
yes bro ..i also want this code ..if any one have than pls send me at MydeveloperCorner@gmail.com
|
|
|
|
|