Peter Chan
asked on
Further go to another URL
Dear,
It would further go to another URL previously, when I click record below
to this URL.
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
But now it does not, and why?
It would further go to another URL previously, when I click record below
to this URL.
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
But now it does not, and why?
ASKER
Sorry to that, it now does not go to the expected URL. What is wrong to the following URL?
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
I dont get what you are asking...
you are showing an image and say, when you click it should go to
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
so, where is that image?
is this the page that yopu click: http://my-friend.co/HouseList4/Default.aspx?userid=mc23
where should it go when you click images on this page?
I showed you what is happening when you click, you have the js code that shows where to go...
I dont get what the issue here...
you are showing an image and say, when you click it should go to
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
so, where is that image?
is this the page that yopu click: http://my-friend.co/HouseList4/Default.aspx?userid=mc23
where should it go when you click images on this page?
I showed you what is happening when you click, you have the js code that shows where to go...
I dont get what the issue here...
ASKER
No, when I click the record (as shown in the screenshot above), I expect it would further go to another URL. But now it does not.
check my first post again...
it is doing what your code says to do so...
it is doing what your code says to do so...
ASKER
when I click it goes to this addressWhy doesn't it go to that URL, when I now click record, within this?
if (window.opener != null) {
//opened via window.open
url = "http://my-friend.co/RegRec2?id=18&user_abbr=mc2&readonly=y";
window.location.href = url;
var myWindow = window.open(url, "myWindow", "width=800, height=900");
}
Select all
Open in new window
http://my-friend.co/HouseList4/JavaScript1.js, Line 195
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
still I dont get it...
it is going to this page
http://my-friend.co/RegRec2/?id=18&user_abbr=mc2&readonly=y
+ opens a new window which goes to same url
http://my-friend.co/RegRec2/?id=18&user_abbr=mc2&readonly=y
this is what your js says... and it is working as expected...
it is going to this page
http://my-friend.co/RegRec2/?id=18&user_abbr=mc2&readonly=y
+ opens a new window which goes to same url
http://my-friend.co/RegRec2/?id=18&user_abbr=mc2&readonly=y
this is what your js says... and it is working as expected...
ASKER
Sorry, now really nothing happens, when I click record within this URL
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
http://my-friend.co/HouseList4/Default.aspx?userid=mc23
$("#houses .houserow").on("click", function () {
//alert($(this).find("td :nth-child(2)").html());
id = $(this).data("id"); //alert(id);
if (window.opener != null) {
//opened via window.open
url = "http://my-friend.co/RegRec2?id=18&user_abbr=mc2&readonly=y";
window.location.href = url;
var myWindow = window.open(url, "myWindow", "width=800, height=900");
}
});
this is your code...
you are getting id... id is only on first row
so, remove "houserow" from 2nd and 3rd row..., put only only on first row...
then when we click on first rows, it will work...
second, you are checking "window.opener != null"
on that page, this will be undefined since nobody opened a window...
so, no need to check window.opener...
$("#houses .houserow").on("click", function () {
//alert($(this).find("td :nth-child(2)").html());
id = $(this).data("id"); //alert(id);
url = "http://my-friend.co/RegRec2?id=18&user_abbr=mc2&readonly=y";
var myWindow = window.open(url, "myWindow", "width=800, height=900");
}
});
now, you are getting id, but do not use it and always open id=18!!!
should be
$("#houses .houserow").on("click", function () {
//alert($(this).find("td :nth-child(2)").html());
id = $(this).data("id"); //alert(id);
url = "http://my-friend.co/RegRec2?id="+id+"&user_abbr=mc2&readonly=y";
var myWindow = window.open(url, "myWindow", "width=800, height=900");
}
});
ASKER
1. I've got a problem to get this ID
2. Now the problem is that it would go to the detail window "two times" (using current window and new window). How to ensure that it would not do double work?
id = $(this).data("house_id");
2. Now the problem is that it would go to the detail window "two times" (using current window and new window). How to ensure that it would not do double work?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks.
How to adjust this
var myWindow = window.open(url, "myWindow", "width=1250, height=1000");
to ensure the window is maximized?
How to adjust this
var myWindow = window.open(url, "myWindow", "width=1250, height=1000");
to ensure the window is maximized?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
http://my-friend.co/HouseList4/JavaScript1.js, Line 195
when we click, you are changing the current page url + open a new window...
url change
http://my-friend.co/RegRec2/?id=18&user_abbr=mc2&readonly=y
new window
http://my-friend.co/RegRec2/?id=18&user_abbr=mc2&readonly=y