473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

parent.location problem with MSIE

Hi all,

I'm quite new to javascript. I'm using the following code:

<a href="javascript: void(0)" OnClick="if(confirm('Are you sure you want
to delete the following items? sv650.jpg,.'))
parent.location='index.php?option=modulemanager&mo dule=11&suboption=show&suboption2=delete&ID3=,52&I D=21&gallerypage=1';">Delete
selected items</a>

Using Mozilla or Netscape (Linux or Windows), this works fine. Using
MSIE, the new url is not loaded.

Any ideas why this happens and any solution?

much thanks in advance,

Martin

Jul 20 '05 #1
4 8360
Martin Herrman wrote on 10 nov 2003 in comp.lang.javascript:
OnClick="if(confirm('..........


Do away with the "if". You need a fals/true return.

<a href="javascript:void(0)"
OnClick="return confirm('Do you want to delete these items?')"
parent.location='index.php?....';">
Delete
</a>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
On Mon, 10 Nov 2003 10:46:49 +0000, Evertjan. wrote:
Do away with the "if". You need a fals/true return.

<a href="javascript:void(0)"
OnClick="return confirm('Do you want to delete these items?')"
parent.location='index.php?....';">
Delete
</a>


Stupid me. Thanks for your help!
Jul 20 '05 #3
Martin, what error do you get? What is not happening?

I have done:

<script language="javascript">
function deletefile()
{
if(confirm('Are you sure you want to delete the following items?
sv650.jpg,.'))
{
parent.location='http:\/\/www.yahoo.com';
return true;
}
else
{
return false;
}
}
</script>

<a href="javascript: void(0)" onmousedown="return(deletefile());">Delete
selected items</a>

and this works in ie 5.5. The bast way is to create a function I think.

Hope that helps.

Stu

"Martin Herrman" <m.*******@student.tue.nl> wrote in message
news:pa****************************@student.tue.nl ...
Hi all,

I'm quite new to javascript. I'm using the following code:

<a href="javascript: void(0)" OnClick="if(confirm('Are you sure you want
to delete the following items? sv650.jpg,.'))
parent.location='index.php?option=modulemanager&mo dule=11&suboption=show&sub
option2=delete&ID3=,52&ID=21&gallerypage=1';">Dele te selected items</a>

Using Mozilla or Netscape (Linux or Windows), this works fine. Using
MSIE, the new url is not loaded.

Any ideas why this happens and any solution?

much thanks in advance,

Martin

Jul 20 '05 #4
Martin Herrman wrote on 10 nov 2003 in comp.lang.javascript:
On Mon, 10 Nov 2003 10:46:49 +0000, Evertjan. wrote:
Do away with the "if". You need a fals/true return.

<a href="javascript:void(0)"
OnClick="return confirm('Do you want to delete these items?')"
parent.location='index.php?....';">
Delete
</a>


Stupid me. Thanks for your help!


On second view, I am partly wrong.

This should work:

<a href='index.php?....' target="_parent"
OnClick="return confirm('Do you want to delete these items?')">
Delete
</a>

And this:

<script>
function checkifdelete(){
if confirm('Do you want to delete these items?')
parent.location.href='index.php?....';
return false;
}
</script>
<a href="#"
OnClick="return checkifdelete();">
Delete
</a>

In both cases the onclick should return something boolean.

The javascript:void(0) is superfluous,
because it will only be uselessly invoked if javascript is off.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: nicver | last post by:
I am working on updating a Web site with a frameset. A page opens a pop-up window in which the user uploads pictures. Once the upload is done, I would like to refresh the content of the frame which...
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
1
by: Helixpoint | last post by:
I have a frameset. left and main. Inside the main frame I have a IFRAME. I need to refresh the main frame when I post a form inside the IFRAME. I am trying the code below with no luck?? ...
2
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an...
2
by: Robert Degen | last post by:
Hello, I got a little problem. Seems very simple: * I want to open a popup window * Popup-window uses data from its father window. BUT a parent.window does NOT point to the real parents...
13
tpgames
by: tpgames | last post by:
What is the onload event handler needed to get # assigned to parent variable? What I tried didn't work! Code is from JS bible, page 127-8 with some minor alterations by me. Parent Page (in part)...
1
by: SunshineInTheRain | last post by:
My project has 3 files, File1 has included master page. file1 consists of iframe1 that load file2. File2 consists of iframe2 that load file3. Javascript used on each file to resize the iframe...
1
by: michal.podlewski | last post by:
Hi All, I have a problem with a simple (as I thought till now) thing: I want to make a link in a child-window which would change site in the parent-window and along with closing child window. The...
5
by: zanzo | last post by:
I want to get to the parent location each time I'm adding a record. the problem is that i have a nested iframes, and each time the number of those is incremented: eg. at first adding record i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.