Forum Moderators: open

Message Too Old, No Replies

Blank page

         

Chart

9:02 pm on Feb 9, 2004 (gmt 0)

10+ Year Member



Hi again!

I posted last week about having a new window open up containing links that get added in a textarea in the parent page when they are clicked. I got an idea how to do it and i'm working on it. But i have a different problem now :).

Thing is 5 minutes ago i had a Expected 'End' error. I looked at my code and found i was missing a End if in my if ... else if structure. So i correct it. Problem is that now, wheni load the page, i get nothing at all. It's a blank page. But if i do back in my browser, and then forward again, i get my page, but an old version... I know this is not very well explained and i can't really post my code in here because it's quite long. Anyway, if any of you have ever seen anything like this, please share any ideas...

Thx in advance!

Chart out.

defanjos

9:18 pm on Feb 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When the blank page is presented, check "view source", the error is probably written there.

This usually happens when the "offending" ASP code in before the <html>

Chart

1:39 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Thx for the tip! However i'm not really awake yet and I don't see anything wrong there. Here's what i got in the original code :

<%@Language="VBScript"%><%response.buffer = true%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="fra">

And here's what I get when I view source :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html lang="fra">

Any ideas welcome...

Thx!

Chart out.

Chart

1:51 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Ok I think that i found my error.. but i'm not sure... it's because of the
<%response.buffer = true%>.

Here's what i got on msdn about the buffer property :

The Buffer property indicates whether to buffer page output. When page output is buffered, the server does not send a response to the client until all of the server scripts on the current page have been processed, or until the Flush or End method is called.

So would that mean that since there's a script on my page that is only called when I click a link, the client doesn't get any ouput? What's the use of using that property? i'm trying to figure out why the guy before me used this...

Chart out.

garann

7:21 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



What does the actual page look like (before ASP processes it)? If you're trying to write the value of a variable in your page, you have to figure out why it's not getting written. Is the variable empty, and being written correctly, or does your script hang, and never write out your variable? Or does the processing of the script happen after you're declaring that doctype?

I guess what I'm getting at is that it might be helpful to see some trimmed-down code...

Chart

7:35 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Ok, here's *some* code. This is the top of my page and my JavaScript function.

<%@Language="VBScript"%><%response.buffer = true%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html lang="fra"><!-- InstanceBegin template="/Templates/page_generale_fr.dwt" codeOutsideHTMLIsLocked="false" -->
<head>

<script language="JavaScript">
function choisir(source, output)
{
newwin = window.open(arguments);
if (!newwin.opener) newwin.opener = self;
with (newwin.document)
{
open();
write('<html>');
write('<body>');
*Here I write the contents of my new window. Right now, i got asp in there i.e :
write('<tag><tag><%Asp code here%>')
Can i do this?
close();
}
}
So that's the function.
Here's where i call it :

<a href="javascript:choisir('Charge', 'opener.document.rech.recharge.value');">Choisir</a>

The objective here is to make a textarea with a link aside it that opens this new window. Inside this new window, i will do a sql request to get some info as links so that it gets added to the textarea in the parent window. Maybe this isn't so clear... Anyway, any input is most welcome =D.

Chart out.

Chart

8:03 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Well, of course, this had to be a stoopid mistake. I just found some syntax errors, and now my page gets displayed. I still got script errors, but i'll get through that =D.

Thx for making me look twice garann!

Chart out.