Click to See Complete Forum and Search --> : cannot view script


bash
03-11-2003, 01:36 PM
I have created a web site within 3 frames, top, middle and bottom. In the middle frame, the javascript drop down menu which i have incorporated shows up as page cannot be displayed on certain computers?

Page cannot be displayed only shows up on certain computers? Does this mean javascript is disabled?

If so, how can i enable it?

Or is there something else wrong?

Hope someone can help.

Thanks in advance :-)

Nevermore
03-11-2003, 01:38 PM
It means it can't find the page. If you linked to it with JavaScript, then it could mean JavaScript is disabled.

Vladdy
03-11-2003, 01:39 PM
Frames are wrong.
If you want a more specific answer, post the code.

Nevermore
03-11-2003, 01:41 PM
Originally Posted by Vladdy:
Frames are wrong.

Wrong? In what way?

Vladdy
03-11-2003, 01:48 PM
http://webreference.com/html/tutorial14/

pyro
03-11-2003, 02:01 PM
Frames are not wrong...They may not be the best way to design your site for reasons such as search engine listings, etc... But, I think it a bit of a stretch to say that they are wrong...

khaki
03-11-2003, 02:08 PM
Hi Vladdy....

Frames may be over-used and mis-used, but they are not wrong.

I myself have eleminated most of my frames pages (because I consider then to be half-dead), but there are times when Frames are right.

However, in the case of a javascript drop-down menu, I beleive that they are wrong (or probably... not right).

The link is interesting, but not definitive (it also does not contain the word "wrong").

And I'm afraid that you may have started the beginning of a really long thread (yikes!)

not one to walk away quietly from really long threads...
k

Vladdy
03-11-2003, 02:23 PM
Using frames for layout - WRONG.
( I would not bother enumerating the reasons, but top 2 are):
1. HUGE accessibility issues
2. Breaking up document semantics

If you need to present one document withing the other - use IFRAME or even better OBJECT which will allow you to provide alternative content (such as link to embedded document).
I can not think of a problem which only solution would require two SEPARATE and INDEPENDENT documents presented within the SAME browser window.
Therefore frames serve no purpose and are WRONG.

khaki
03-11-2003, 02:33 PM
Interesting.

OK...
how 'bout this...

A frames page (2 pages).
1 left, 1 right.

On the left, a form.
On the right, a table of ASP generated data generated by values supplied by the form.

Can it be done in an IFRAME (where the form could be sumbitted over and over again)?

I'm asking you (not challenging you), so I'd appreciate your view on the possibilty of not using frames for that type of application (since that is my last hold-out use of frames).

Thanks
k

Vladdy
03-11-2003, 02:43 PM
Originally posted by khaki
A frames page (2 pages).
1 left, 1 right.

On the left, a form.
On the right, a table of ASP generated data generated by values supplied by the form.

See, you presented a solution: two frames one input - another output.
What problem are you trying to solve doing it?
Is it database (server) interaction without reloading a page, such as chat application?

khaki
03-11-2003, 04:21 PM
It's hard data (not chat. grrrrr ) from a db.

The "right" page recieves variables from the form on the "left" page, to populate an SQL expression (and some ASP delimiters).

With the frames method, I do not have to request and rewrite everything ... just the resulting data in the "right" page.

I already mentioned that this is the last use that I have for frames.

I'm not looking for an argument... just a discussion. So... is there a better way to execute what I have described above without the use of frames?

obviously eliciting a lot of attitude today...
k

Vladdy
03-11-2003, 05:10 PM
You can utilize the following method for background server polls, which would result in minimum server load and traffic:

Instead of submitting a form, construct the query string yourself from the form data so the result is something like:
query = "?param1=value1&param2=value2&param3=value3".
Create a script node dynamically, set it's source to your server-side script that retrieves data from db, and attach the node to the document head. That will send the http request to server.
Make the server side script process the request and return the data in a form of a javascript call:
displayData('delimeted string');
displayData function would process the delimited string and create whatever presentation elements are required (table for example).

Here is the function that I wrote some time ago that sends form data to the server in this manner. It shows the principles, however there is no mechanism that would prevent an error when a new request is submitted prior to the completion of the current one.
function sendForm(formName,actionFile)
{ forms = document.getElementsByTagName('form');
if(forms[formName]) form = forms[formName];
else return false;
queryString=actionFile + '?'
for(i=0; i<form.elements.length; i++)
queryString += form.elements[i].name + '=' + escape(form.elements[i].value) + '&';
queryString = queryString.substring(0,queryString.length - 1);
script = document.createElement('script');
script.src = queryString;
document.getElementsByTagName('head')[0].appendChild(script);
return true;
}

I have a more complicated serverPoll object written that takes care of multiple request logistics.

khaki
03-11-2003, 05:36 PM
hmmmmm....
I think I just figured something out....

Instead of making me feel stupid....
you've decided to prove it instead.
(wink).

Now how am I supposed to wrap my head around that Vladdy?

Ugh. You make this girl think way too hard. hmmph!

But listen... I asked... you answered.
I'll look at it.... but please...
Is it worth changing my familiar ways to learn this method?

Does it solve headaches instead of create more of them?
Is it better... or just different?

I'm not a sheep (I prefer the company of wolves actually. lol), but I'm also not
looking to just chase my tail (although that job is currently open. LOL).

OK. So... let me ask...
This code sends the form values back to itself?
How do I extract it (I need to populate an SQL statement and ASP delimiters y'know).

I'll give it a go... but it's not very intuitive for converting straight-forward ASP
form value retrieval.
Can I get a clue (at least)?

... and please ...
speak to me like I don't understand (you fly right over my head sometimes).

I'm game, Vladdy.
But... baby steps (if that's ok)

my brain hurts... but that's probably a good sign...
k

Vladdy
03-11-2003, 06:25 PM
The method will be limited to DOM compliant browsers with javascript enabled. Tested to work with IE5+ and Gecko based NS6+ and Mozilla (>90% of current market and RIZING!!!) One can argue which method has more accessibility issues, but I assume you need to provide an alternative data access in both cases.
The advantages I see (besides the absence of frames) are:
1. Better interaction between input and output fields. For example, you have some data that has date field. When creating a control where user selects a date range, the server can be polled for available dates.
2. Minimum traffic. Server side script sends data only (with minimum delimiters). It does not concern with data presentation (HTML mark-up). This also allows you to separate data from presentation: easier to implement changes.
3. Truly background server polling. You can realize a queue of requests which will be transparent to the user.
4. Minimum page changes on update. The HTML element that contains new data can be created in the background and presented at once (node.style.display = 'block');
5. You can poll different server side scripts if needed
6. Your server side code becomes much cleaner - you no longer need to worry about HTML mark-up.

For example you have a DB of books with fields "author", "title", "price"

On the page load you want to present visitors with the list of authors, so you make your html page send a request
script.src = "dataServer.asp?request=authors"
Then your asp code would be something like that:

action=Request.QueryString('request');
if(action == 'authors')
{ SQLString = 'SELECT DISTINCT Books.author FROM Books';
rs.Open(SQLString,DBConnection,3,3)
authorlist = '';
while(!rs.EOF)
{ authorlist+=rs('author').Value + '$';
rs.MoveNext();
}
rs.Close();
%>displayAuthorList('<%=authorlist%>');<%
}

Then the function on the server side that displays the list of authors would be something like

function displayAuthorList(authorsString)
{ authors = authorsString.split('$');
listDiv = document.getElementById('authorList');
for(i=0; i<authors.length; i++)
{ with(listDiv.appendChild(document.createElement('a')))
{ href='dataServer.asp?request=Books&author='+escape(authors[i]);
appendChild(document.createTextNode(authors[i]))
}
}
}

Get the idea?
;)

khaki
03-12-2003, 11:06 AM
Vladdy... I'm trying...

...but I don't think that I fully understand (ugh!)

I originally taught myself how to implement databases and SQL from the working examples
at ASP101.com and sometimes I just need to see the full visual in order to break down it's
logic and understand it's elements.

This is not visually clicking in my head, and right now my mind is frayed at the ends.
But let me try to understand one more time (i'm very determined):

When you say "on the page load" that I need to send a request
script.src = "dataServer.asp?request=authors"
I'm not even sure how I'm supposed to implement that... and what else is ON that page?
Anything?
I'm very confused about that. It's an HTML page, right?

And I assume that...

action=Request.QueryString('request');
if(action == 'authors')
{ SQLString = 'SELECT DISTINCT Books.author FROM Books';
rs.Open(SQLString,DBConnection,3,3)
authorlist = '';
while(!rs.EOF)
{ authorlist+=rs('author').Value + '$';
rs.MoveNext();
}
rs.Close();
%>displayAuthorList('<%=authorlist%>');<%
}

... is within the ASP file named dataServer.asp (right?)

But then I dont undersatnd where the function goes. In the dataServer.asp
page as well?

(sigh....)
I frustrate myself so much sometimes, because I am self-taught (well... with a lot of help
from sources like this one), and I know that I have major gaps in my knowledge of things
that I really should know in order to do this kind of stuff.
But I try so hard to understand - it's just that I can be very high-maintenance about it
sometimes.

If you have the time (and the patience), I would be grateful for any further explanation
that you can provide. But if not, that's fine... I'll try looking at it again with a fresh mind
another time.
This is the 2nd time you put my brain into this state. I was able to sort-out the 1st time.
This one... not so easy for me.

licking intellectual wounds...
k