Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2010, 12:55 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default Querystring and HTML file

I have seen following code in very famous website (sittercity*com). The code passes values in query string to a html file.

Quote:
function sendAjaxRequest( ajax_include, parameters, send_result_to )
{
var ajax = createAjaxObject();
var resistCache = new Date().getTime();

url = '/ajax_dispatcher.html?ajax_include=' + ajax_include + '&' + parameters + '&send_result_to=' + send_result_to + '&dummy=' + resistCache;
ajax.open( 'get', url, true );
ajax.onreadystatechange = function () { handleAjaxResponse( ajax ); };
ajax.send( null );
}
My question is, is it possible to pass values to a html file in query string? If no then how is this website doing it?
 
Old November 28th, 2010, 02:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes you can. The extension itself says nothing about its capabilities. All by itself an HTML file can't do much, but if you map it to some processor such as PHP or ASP.NET, it behaves the same as native files for the processor.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 29th, 2010, 01:07 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

So what you mean is that .html file does nothing and is used to redirect to php or asp.net file. If so then what about the values passed in query string?
 
Old November 29th, 2010, 03:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, that's not what I meant at all. What I said is that an HTML could be mapped to a server so it's processed as if it were an ASPX, ASP, PHP, JSP or whatever file.

A file extension is just a name; it doesn't have any built-in behavior all by itself. For a dynamic page (aspx, etc) to do something useful, it needs to be mapped to a piece of software that processes it. An .aspx page is mapped to asp.net; a php file is mapped to php. It's easy to map other file types like HTML to a server side handler so they can act (and contain code) like any other dynamic file.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
convert HTML File to PDF file in vb.net gaurikhot .NET Framework 2.0 4 June 16th, 2014 02:33 AM
converting a HTML file to png file timcyberbanjo General .NET 0 October 21st, 2008 04:30 PM
Getting a Text file from a HTML File or web page rajesh.java Java Basics 1 January 20th, 2007 08:36 AM
Converting an XML File into a HTML File ewan XSLT 2 October 4th, 2004 09:12 AM
reading HTML from file -> write to file mikeuk Beginning PHP 4 July 21st, 2004 05:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.