|
|
|
|
HTML and Java Questions If you want the use to see a new copy of the page every time, use the following meta tags in the <HEAD> of your document : <meta http-equiv="Pragma" content="no-cache"> The ASP equivalent of this is : <% Response.CacheControl = "no-cache" %> However, there are some occasions where these do not work. For MS KB information on this click here Refreshing Pages and Redirecting Browsers If you want your page to reload in the user's browser use the following meta tag. <meta http-equiv="Refresh" content="10; url=http://www.yourpage.htm"> The 10 specifies a ten second wait before refresh, the url statement is the location of the page to refresh or redirect to. Redirecting Browsers from Dropdown Lists This can be achieved with the use of a little JavaScript and some tweaking to the form, holding the drop down list. First of all, place one of the following scripts (depending on which one you need) in HTML view, above the form's code: (For links to load in the same frame or browser window) <script language="JavaScript"> (For links to load in a new browser window) <script language="JavaScript"> Note the "page1.htm, page2.htm, and page3.htm" references. These will need to be altered to suit. If referencing pages outside your own site, remember to include the entire http://www.sitename/pagename.htm reference. Secondly Alter your form so the code looks something like this: <form method="POST" onSubmit="" name="wsform"> Options will need to be changed to suit you own needs. You can also add more items but remember to add extra if statements to the JavaScript, for them too. For more information and other solutions to this see the MS KB Article Here. If you need to preload several images then use the following JavaScript in the <HEAD> of your document. The Items in bold will need to alter to suit. Please note that this script will only work with Netscape 3 (and above), IE4 (and above) and other browsers that support the JavaScript 1.1 image object. All other browsers (including any browser with images turned off) will ignore the script. <script language="JavaScript"> arImageList = new Array(); The "yourimage" statements are where your image names go. You can add or subtract from this list. The last line assumes that all your images are in the "images" folder of your web, and are all "gif" files Please note that the last "yourimage" statement in the array, has no comma after it. If you put a comma there you will get an error. The original script came from http://www.webreference.com but I would also like to thank Jim Ley for making the script more "forgiving" to earlier browsers. If you are using shared borders, you will notice that you cannot directly get at your shared border HTML from your web pages. But you can edit the shared border files directly. These are located in the "_borders" folder in your web, and are called "top.htm", "left.htm", "right.htm" and "bottom.htm". If you cannot see this folder in FP's folder list, go to "Tools | Web Settings" in the menu and click the "Advanced" tab. Then check the "Options" box that says "Show documents in hidden directories". One of the annoying things about FP is the way it inserts the following meta tags : <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> Every time you delete them and save, they come back ! If you want to get rid of these, then there is an excellent add-in available, see Jimco's FP2000 Add-ins Opening a Page in a Fixed Popup Window This is one of the most asked JavaScript questions I did have scripts here to show you how to do it, but now there is now an add-in for this available at http://www.jimcoaddins.com/com.aspx called Spawn, which creates the scripts for you. When a link is clicked Spawn is setup to do this for you. Just select the link and run Spawn. When a page loads This is a little more complicated than the solution above. Make a dummy link to do the same as what you require, as explained above, so Spawn can create the script for you. Now switch to HTML view and copy the code from the onclick part of the dummy link, paste it into the <body> statement of your page, then change the word onclick to onload. For example, copy (what you see here in bold) : <a href="http://yourpage.com" onclick="spawnJimcoPopup('http://yourpage.com','OurSite','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no','10','10','0','0','pixel');return false;"></a> and paste to your <body> statement <body onload="spawnJimcoPopup('http://yourpage.com','OurSite','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no','10','10','0','0','pixel');return false;"> Once you have done this, you can delete the dummy link you used to create the script with Spawn. WARNING : If you already have a statement using <body onload>, you need to separate the two with a semi-colon. For example : <body onload="spawnJimcoPopup(blah blah blah)" ; "dynAnimation()"> Closing the Popups Of course, with the examples above, the user can close the popup windows manually. But what if you want the popup to close itself after a given period ? If you want the popup to close by itself, after a certain period of time, then paste the following code into the <body> statement, of the popup page (not the page that calls the popup) : <body onload="window.focus(); setTimeout('window.close()','5000')"> The "5000" specifies a 5 second delay, before the popup closes. Also note that the same restrictions apply here too, to the use of <body onload="">, as discussed beforehand. Finally, kudos to Jimco, who once again has made life a lot easier for us all. Stop My Site from Being Framed When I first designed this site it was a framed site. Any links outside it were loaded into the main frame, where you see this text now. I didn't do this deliberately, it was just the default target I had set for the page. Looking at some of the sites in this frame made them cluttered, and sometimes they did not function correctly. I have since stopped this from happening, by specifying "whole page" targets for any external links (although this no longer applies, as this site no longer uses frames). If you want to stop other sites from showing your site within a frame, put the following JavaScript, in the <head> statement of your HTML, on your homepage. <script language="Javascript"> This site uses this script, which was kindly given to me by an expert at a FP Newsgroup. Stop Pages from Being Opened Outside a Frameset Completely the opposite for the solution above, this script stops people opening pages meant for a frameset, outside a frameset. The script redirects the browser to the frameset page, if the script detects the page is not loaded within a frame. It is basically variation on the script above, that I altered to suit. Here is the script that should be placed in the <head> statement of your HTML. The items in Bold will need to be changed to suit your requirements. <script language="Javascript"> Thanks to the MVP who gave me the original script, and also to Shane Fowlkes for the inspiration. Making a Link / Button to Print Page To make a link to print the page containing the link, you can use window.print() in the onClick section of the link. Below is an example of a simple page that prints itself when the link is clicked. <html> Source : James Goulden - ODT Web Designs Alternatively, if you want a button / image to print a page, then use the following URL for the default hyperlink, in the image's properties : javascript:window.print() Controlling Which Pages Get indexed by Search Engines Most search engines these days, no longer use "crawler-bots" to index your website. However, for the ones that do, you can use "Robots META Tags" to control which pages should, and shouldn't be indexed. You can also control which links they should follow. The following examples are META tags that should be placed in the <Head> section, of your pages. <meta name="robots" content="index, follow"> Tells the search engine to list the page, and follow any links on the page. <meta name="robots" content="noindex, follow"> Tells the search engine not to list the page, but follow any links on the page. <meta name="robots" content="index, nofollow"> Tells the search engine to list the page, but not follow any links on the page. <meta name="robots" content="noindex, nofollow"> Tells the search engine not to list the page, or follow any links on the page. All products and company names mentioned herein are the trademarks of their respective owners. |