Why would anyone DO this?? Am I missing something

S

Stephanie Stowe

You have a page. On top of the page, there are some search criteria and
other input elements and a submit button. The submit button is clicked,
sending a request to the server. Server-side code is executed to write
client-side vars. Based on these vars, divs are shown or hidden.

Why not just write or not write the html stuff server-side? I cannot
understand it. And it is UGLY. If other client-events were going to interact
with the divs, I could see it. But... they aren't. The page is always posted
back to itself for any kinds of show/hide stuff.

What am I missing?

S
 
R

Ray Costanzo [MVP]

Well, it's hard to say without seeing the resultant HTML, but perhaps
because options exist to show the content in those DIVs with some
client-side action? If not, then, no, it doesn't make any sense to return
content that will never be displayed or used in any way.
 
J

Jeff Cochran

You have a page. On top of the page, there are some search criteria and
other input elements and a submit button. The submit button is clicked,
sending a request to the server. Server-side code is executed to write
client-side vars. Based on these vars, divs are shown or hidden.

Why not just write or not write the html stuff server-side? I cannot
understand it. And it is UGLY. If other client-events were going to interact
with the divs, I could see it. But... they aren't. The page is always posted
back to itself for any kinds of show/hide stuff.

What am I missing?

It's what we're missing. We're missing the page/code in question to
see what it does, and we're missing the intentions of the original
programmer.

It could be they did that because they didn't know how to do it
client-side. It could be they did have a server-side reason that is
no longer valid and haven't updated the code. It could be the server
side operation is for securing data or preventing client-side spoofing
of some sort. It could be simply because each server request
generates a log they can use to track activity on their site and the
user's experience.

Jeff
 
S

Stephanie Stowe

I guess I am glad to hear this. I was looking and looking at this stuff,
when I finally understood what was happening, I was flabergasted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top