Click here to Skip to main content
15,923,006 members

Comments by G.Mahendra (Top 3 by date)

G.Mahendra 3-Nov-16 2:35am View    
Deleted
Thanks Richard

First i tried below code for "Previous and Next"functionality. But it doesn't fulfill my requirement.


Go Back

Go Forward

By using this script code back button only working forward not working.

After that we think to get URL and store it in array as above.

Now i tried on another way also for getting url.



<title>


var urllist = [];
var ind = 0;
function WhichButton(event) {
if (event.button == 0) {
$(document).ready(function () {
var pageURL = $(location).attr("href");
urllist[ind] = pageURL;
ind = ind + 1;
alert(pageURL);
});
}
}
function goBkHist(a) {
var l_ref = ind - 2;
var pageURL2 = urllist[l_ref];
ind = l_ref + 1;
alert(pageURL2);
loadUrl(pageURL2);

}
function goFdHist(a) {
var l_ref_2 = ind;
var pageURL2 = urllist[l_ref_2];
ind = l_ref_2 + 1;
alert(pageURL2);
loadUrl(pageURL2);
}
function loadUrl(newLocation) {
window.location = newLocation;
return false;
}











Actually what happen is i try to get URL by click on mouse-left click.In the above code i got URL successfully but when i try to click on buttons also mouse-left event fires button event not fired.

How can i solve this problem.If i placed buttons in another div it works fine. But my requirement is need to place buttons in same div only otherwise i am facing issues with design.

How to avoid mouse-left click event at the time of button click.
G.Mahendra 3-Nov-16 2:31am View    
Deleted
Thanks Richard

First i tried below code for "Previous and Next"functionality. But it doesn't fulfill my requirement.


Go Back

Go Forward

By using this script code back button only working forward not working.

After that we think to get URL and store it in array as above.

Now i tried on another way also for getting url.



<title>


var urllist = [];
var ind = 0;
function WhichButton(event) {
if (event.button == 0) {
$(document).ready(function () {
var pageURL = $(location).attr("href");
urllist[ind] = pageURL;
ind = ind + 1;
alert(pageURL);
});
}
}
function goBkHist(a) {
var l_ref = ind - 2;
var pageURL2 = urllist[l_ref];
ind = l_ref + 1;
alert(pageURL2);
loadUrl(pageURL2);

}
function goFdHist(a) {
var l_ref_2 = ind;
var pageURL2 = urllist[l_ref_2];
ind = l_ref_2 + 1;
alert(pageURL2);
loadUrl(pageURL2);
}
function loadUrl(newLocation) {
window.location = newLocation;
return false;
}











Actually what happen is i try to get URL by click on mouse-left click.In the above code i got URL successfully but when i try to click on buttons also mouse-left event fires button event not fired.

How can i solve this problem.If i placed buttons in another div it works fine. But my requirement is need to place buttons in same div only otherwise i am facing issues with design.

how to avoid mouse-left click event at the time of button click.
G.Mahendra 20-Sep-16 14:22pm View    
Thank you