Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing an Email Link

Status
Not open for further replies.

jon24422531

Technical User
Jan 27, 2004
295
GB
Hi guys

Here is a very good reason to stop cutting and pasting code with out knowing how it works. Sadly I've never really understood JavaScript....

I have an internal website that Emails a User when their helpdesk question has been updated and there is a link:


This opens in a frame thanks to the following code in both the index page:
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
defaultsubpage="UserStart.asp";
if (location.search) {subpage=location.search.substring(1)}
else {subpage=defaultsubpage}

if (subpage.indexOf('&&&')>=0) {
prefix=subpage.substring(0,subpage.indexOf('&&&'))+"://";
suffix=subpage.substring(subpage.indexOf('&&&')+3,subpage.length);
subpage=prefix+suffix;
}
// -->
</SCRIPT>
</HEAD>


<SCRIPT>
document.write('<FRAMESET ROWS="10,*,0" BORDER="0" FRAMEBORDER=No FRAMESPACING="0">');
document.write('<FRAME NAME = "HEAD" SRC="Header.html"  BORDER="0" FRAMEBORDER=No SCROLLING="NO" NORESIZE >');
document.write('<FRAMESET COLS="200,*" BORDER="0" FRAMEBORDER=No FRAMESPACING="0">');
document.write('<FRAME NAME = "NAV" SRC="Navigate.asp" BORDER="0" FRAMEBORDER=No SCROLLING="NO" NORESIZE >');
document.write('<FRAME NAME = "CENTER" SRC="'+subpage+'" BORDER="0" FRAMEBORDER=No SCROLLING="AUTO">');
document.write('</FRAMESET>');

</SCRIPT>
and also in the opening worklogOpenDetail.asp page:
Code:
<script>
function detect()
{
framesetpage="Index.html";
thispage=window.location.href;
if (thispage.indexOf('://')<0) {thispage="://"+thispage;};
prefix=thispage.substring(0,thispage.lastIndexOf('://'));
suffix=thispage.substring(thispage.lastIndexOf('://')+3,thispage.length);
// alert('the subpage is:['+prefix+']['+suffix+']');
if (parent.location.href==window.location.href) {parent.location.href=framesetpage+"?"+prefix+"&&&"+suffix};
}
</script>

If I change the link (generated by SQL Mail)
(note that there is an additional folder)
It no longer opens in the frame, but as a new page or tab. What do I need to alter in the JavaScript to get it to point to the new folder and open in the frame as before?

Coding is like Shakespeare; I can read it, even appreciate & understand it, but I could never write it.

Jonathan
 
as a technical user, can you explain to me how on earth you expect anyone outside of your network to click those links you provided?

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Hi vicverk

That is just the point, only people within our network (or on the VPN) can access our Intranet. I don't want you to click them, I was just showing what did work, but now will not after I added another folder above the I just need to add the "WorkLogs" folder in the JavaScript but I don't know where.


Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top