473,698 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parent.location problem with MSIE

Hi all,

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

<a href="javascrip t: void(0)" OnClick="if(con firm('Are you sure you want
to delete the following items? sv650.jpg,.'))
parent.location ='index.php?opt ion=modulemanag er&module=11&su boption=show&su boption2=delete &ID3=,52&ID=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 8369
Martin Herrman wrote on 10 nov 2003 in comp.lang.javas cript:
OnClick="if(con firm('......... .


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

<a href="javascrip t: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="javascrip t: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="javas cript">
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="javascrip t: void(0)" onmousedown="re turn(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.*******@stud ent.tue.nl> wrote in message
news:pa******** *************** *****@student.t ue.nl...
Hi all,

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

<a href="javascrip t: void(0)" OnClick="if(con firm('Are you sure you want
to delete the following items? sv650.jpg,.'))
parent.location ='index.php?opt ion=modulemanag er&module=11&su boption=show&su b
option2=delete& ID3=,52&ID=21&g allerypage=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 #4
Martin Herrman wrote on 10 nov 2003 in comp.lang.javas cript:
On Mon, 10 Nov 2003 10:46:49 +0000, Evertjan. wrote:
Do away with the "if". You need a fals/true return.

<a href="javascrip t: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.ph p?....';
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
10599
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 opened the pop-up but so far have failed. Here is my code: <% (ASP code which saves the photo in a database) %>
2
23501
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 window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
1
4728
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?? Private Sub addMachine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addMachine.Click Dim sScript As New System.Text.StringBuilder sScript.Append("<SCRIPT language=""javascript"">" & vbCrLf)
2
23500
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 iframe on my page whose html has the refresh meta as follows : <meta http-equiv="refresh" content="10"> The iframe is effectivelyh refreshed every 10 seconds without having the
2
19230
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 window. Alerting parent.window.location.href shows me, I'm at the wrong window location.
13
3580
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) <!-- start function goNext() { var currOffset = parseInt(parent.currTitle); if (currOffset < 40) { currOffset +=1; parent.cryptogram.location.href = "http://www.tpgames.net/gaming/2/word/cipher/f/c/c" + currOffset + ".html";...
1
3534
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 height based on the each iframe's content height. It is work well on IE, but the error "has no properties" occured with firefox on code as below. Where both code is to get the id of iframe on file1....
1
4505
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 parent window name is "main". A made a link like this in the child-site: <a href="new_address.html" target="main" class="about" onclick="javascript:main.location='new_address.html';self.close();"> change and close </a>
5
3085
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 have the location like this: parent.location second: parent.parent.location third: parent.parent.parent.location how could i get to the initial location, without adding each time "parent."
0
8668
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9014
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8855
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7708
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.