MattEvans 473 Veteran Poster Team Colleague Featured Poster
<script type="text/javascript">
function addSidenote(){
  var myTextArea = document.getElementById("commentBox");
  myTextArea.value = myTextArea.value + '[dohtml]<span class="sidenote" title="Text"></span>[/dohtml]';
}
</script>

<textarea id="commentBox"/>

<input type="button" onclick="addSidenote();" value="Add a Sidenote"/>

That code will create a new textarea for the benefit of demonstration. You'll want to link it to your existing textarea. Looking at the source of the page in your link; this is your textarea:

<TD><b>Quick Comment:</b></TD></tr><tr><TD><textarea cols="40"rows="5" scrollbars="yes" name="field1" 
value="" ></textarea></TD>

You'll want to add an id attribute to that text area; something like this:

<TD><b>Quick Comment:</b></TD></tr><tr><TD><textarea cols="40"rows="5" scrollbars="yes" name="field1" 
value="" [B]id="commentBox"[/B] ></textarea></TD>

Now if you remove the textarea from my example; and put the code on your page somewhere, the code will relate to your comment box; and should work ok.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well, here's why anyway:

http://www.gnu.org/prep/standards/html_node/Quote-Characters.html

Perhaps it's only certain fonts that show the first quote as being a little slanted from topleft-to-bottomright; or perhaps the 0x27 character was supposed to slant the other way and got straightened over time for simplicity's sake.

O_o interesting nonetheless

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm, why not just use normal (matched pairs) single or double quotes then?

type "hello" to invoke "system shutdown"

or

type 'hello' to invoke 'system shutdown'

Why have a backtick as the first quote and a single quote as the second quote for a block?

It's only in certain types of documentation that the quoting is done this way, it's only done in documentation and not program code, and I've seen it too frequently to dismiss it as multiple typos..

I can't find any examples now I've mentioned it; if I do, I'll post them here...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'd use CSS:

<td style="text-align:right;">£993535.00</td>

Edit:

Lol. I didn't read this far:

Edit: Please ignore this message. This idiot (me) just discovered he's been trying to align the table from within the <FONT> tag instead of the <TD>tag. Sorry to waste anyone's time.

I'd still use CSS. You could do this:

<style type="text/css">
td.currency{
  text-align:right;
}
</style>

...
<tr>
<td class="currency">£993535.00</td>
</tr><tr>
<td class="currency">£92464693535.00</td>
</tr><tr>
<td class="currency">£163573535.90</td>
</tr>
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well. You'll need access to a GSM server; (you can hire access the same as you would to a HTTP server). You'll need a contract with an SMS service provider (which is often included with GSM server packages). You'll need a premium rate SMS number (I have no idea how you'd get one of those).

After sorting all that out you just need to make a website, you'll probably want a site for desktop pcs, and a site for mobiles (you don't really need to use WML for WAP anymore because alot of phones come with highspeed full content internet connections these days).

And then you need to get hold of your ringtones (you'll probably have to pay for them unless your making them yourself), categorise them intelligently and give every ringtone a unique ID, put previews on your desktop website where you advertise the ID and your premium SMS number (and work on ways to stop people like me downloading your previews and sending them direct to my phone). Then, write some code to run on your SMS server to relate a received ringtone ID code with a ringtone and send that ringtone in an MMS/SMS+attachment message back to the phone number that requested it.

I'm afraid I can't help you anymore than that. I've never done this; I was planning to do something similar at one point, and did an amount of research.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Black magic perhaps?

You can't convert a binary executable file into an XML file. Of all the things XML may be, a programming/compilable language it is not. Perhaps you could get a script interprettor that worked with XML, but a translator from an EXE would be another matter entirely.

You might be able to convert a database into XML though. I imagine there are tools to do that, and it could even be done manually. I wouldn't advise it personally, because a straight 'translated' XML version of a small database (just tables without relationships) would be much larger than the original database, and cross-hierachy relationships (i.e. relationships beyond the obvious structure of a document) aren't easy to express using XML.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Alot of (mainly linux/perl/etc) documentation, websites and comments use this quoting style:

Type `hello' to invoke `system shutdown'.

Is there any particular reason to start the quoted block with a backtick (`) and end with a single quote (') ?

This isn't really a support question, I'm just intrigued...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

What exactly is that you're trying to do? If you give more complete details of your ultimate requirements; it will be easier to work out what needs to be done.. Be as detailed as possible.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Is there a standard way to make constants defined using the use constant pragma available to all of the packages that are use'd from an executed file?

Or even better, to make the constants defined in a package available to other packages that use that package? It seems like anything defined using use constant is only available in the scope of a single package (and is even unavailable to OO packages that use @ISA to inherit another package).

That means having to declare certain constants multiple times. Which kind of defeats the purpose of these constants.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

In Windows: to create a button in the taskbar/hide a window; you need moderate-to-extensive access to the Windows API or lower. Javascript is a high level (and highly restricted) language designed to be deployed through browsers (which may or may not be running on Windows). Naturally; for too many reasons to list here; you cannot get that level of access from Javascript. If you could; I wouldn't leave Javascript turned on. On any other OS; the same hopefully applies.

You could do this if you were writing your own standalone application or browser plugin. But not from any webpage; and not with javascript.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

that's not the reason there's no 100% height.

100% height has existed. it means all of the height in which information is displayed, or in terms of width, 100% of the width in which information is displayed.

some browsers have picked that up as being 100% of the visible window, others have picked it up as being 100% of the size of all of the objects on a page.

Percentages absolutely do not need units, just a qualifier; i.e. 'height'. 100% of the height means the same in pixels, centemeters, or feet. That's part of the usefulness of percentages.

100% of the window is alot more useful than 100% of the height of objects in the window. If you've ever worked in application GUI design, it's much more important to be able to scale an interface for a display without needing to know the size of the space that you have available than to how much of that space you are currently using. Knowing the resolution doesn't help much atall because my browser window might be one tile in a 4 x 4 layout on my desktop.

The best (perhaps only) way to scale to the size of the browser window in later standards (XHTML) is to use hacky Javascript. Heck; Firefox thinks that in XHTML, a body background color should only be aplied to areas with content or when you have a set 'body height' >_< That's being pedantic to the extreme.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Eek. Be careful that you check that the page still looks ok on all of your target browsers.

Try and look for a document type that doesn't cause ill effects but is still standardised, perhaps one of the latest HTML (4.0) ones.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

How would you change the document type this late in the game.

Probably; delete it from the top of the page and see what happens :mrgreen:

Personally, I'd try and work around it rather than remove it. If you set the body height to something like 1400 pixels using CSS; then 100%/backgrounds will work; but you'll have a long scrollbar on your pages.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

That's a very open question. It's almost like asking "does anyone know how to create a website?".

Do you want to make a website that sends ringtones over a GSM server (SMS messages) directly to units? Or a website where people can download music using their WAP browsers? Do you want to charge people for the ringtones, or give them out for free?

If I upload a MIDI file onto any webspace I can access, go directly to that link from my mobile's WAP browser, and press 'Save' it becomes a ringtone. That's a very basic ringtone website.

Then you have the other end of the scale; popular sites with huge song databases updated every hour, premium text lines to request songs, immediate SMS delivery, online previews/payment gateways/credit systems, well designed WAP and UMTS (3G) optimised access portals; et-cetera.

What you want probably falls somewhere between those two extremes... But there's still alot to think about, and no way anyone can give a useful answer to your question without some more details.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The entirely grey background works how you want in opera (although the images appear too high on the page to be seen properly). The background is short in Firefox 2, but the image appears in the center of the page and is visible.

I've noticed this happen often (always) in Firefox when you use XHTML and 100% height (and/or background properties). This is not the correct behaviour. In these contexts, 100% should be the height of the navigator window or the contents of the body, whichever is largest.

There's not much you can do about it, except set an absolute height for the body; which is a pain because how big is a window?, or remove the XHTML doctype and let browsers assume their quirks modes

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'm assume that you don't want border's around the inputs rather than around the form :- a form is a container for inputs, buttons etc; inputs are the individual 'fields' of a form.

Ok, to remove the border from an input; try this:

<input type="text" style="border-style:none;"/>
and for textareas:
<textarea style="border-style:none;"/>

if you want to disable borders for all inputs and textareas, add this to any applied CSS block:

input{
	border-style:none;
}

textarea{
	border-style:none;
}

that won't remove the background color from the inputs mind, you'll have to make them the same color as the page background. I don't know if it's possible to make them transparent; perhaps it is.

To 'hide' a button is relatively easy; but getting it to come back again might be difficult...

Try:

<input type="Submit" onclick="this.style.display = 'none';"/>

like I say, getting it to come back at the right time might be hard...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

it would be cool if you could browse the shop in 3d and pick up and examine 3d products

That would annoy the flip out of me; unless it was very well done.

Could 3D improve product presentation in an online-store?

Providing it's well done, not over-the-top, and it's quick loading.. If it's an essential part of the store (i.e. you couldn't use the store without it); then only if it's compatible everywhere, or a compatible alternative provided without having to look for it: one thing I hate is: 'You can't view this page because you don't have latest version of [insert as applicable]'.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you want the bottom of the chain to 'overlap' the top of the buttonbar by some amount, it will be different, you'll have to position the image manually, or slice up your images strangly.

do you have an online version of the page? it would help to be able to look at it with all pictures in place and with a browser.

looks like a nice design, by the way.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Is the chain a part of the bottom of the image with src=../toppartpsd copy.png?

If so, I think perhaps the problem is where you've used a 'P' tag around the image...

Try replacing:

<p align="center"><img src="../toppartpsd copy.png" width="800" height="214" /></p>

with

<div style="text-align:center;">
<img src="../toppartpsd copy.png" width="800" height="214" />
</div>

if you're finding that the image is becoming aligned to the left with that code, try:

<div>
<img style="margin-left:auto;margin-right:auto;"  src="../toppartpsd copy.png" width="800" height="214" />
</div>
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well vssp. I don't have any idea as to the correct solution. Which is why my advice to you would have been to post the question in the PHP forum.

Your question has absolutely nothing to do with HTML, CSS or Javascript; and while perhaps some people who visit here would be able to help you, there's more chance someone in the PHP forum or even one of the Linux forums will be able to help you, and might even see your question sooner.

If there was some hint of frontend/HTML stuff in there, perhaps it'd fit in OK here. But there is not, and this is the HTML, CSS and Javascript forum.

MattEvans 473 Veteran Poster Team Colleague Featured Poster
MattEvans 473 Veteran Poster Team Colleague Featured Poster

I had a similar intention, and hit exactly the same problem (worked offline but not online); here's what I did:

http://www.daniweb.com/techtalkforums/thread63673.html

That relies on you being able to instantiate an object from the 'use' and return it from the eval... If the module that you use is non OO, perhaps you'll have a problem doing that O_o

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Where I said [object].text it wasn't literally what you should type =P

[object] relates to an arbitrary object refence; in this case, it would be a textarea that is returned from the document.getElementById([String]) function. [String] means a line of characters, in this case, the ID of the element you want to 'get'.

The times where I've put square brackets are just a notation, and probably not a formal notation either. For the benefit of explaining myself, they mean 'replace this with some object of the type within the brackets'.

if you wan't to 'capture' an object reference, you can do it like this:

var myText = document.getElementById('test');

You can then use member methods and properties of that (myText) type of object.

For a textarea; the text inside is stored in the 'value' property (not the 'text' property as I said previously). So, to add to the text inside a textarea, you could do:

var myText = document.getElementById('test');
myText.value = myText.value + "hello";

Running that code will add 'hello' to the text in the textarea with id 'test'. That should be easy enough to adapt for adding any string to any textarea.

The problem you may encounter, if you're trying to do what I think you are, is that the value of the textarea will always be shown as plain text (i.e. HTML tags will be displayed literally with angle brackets et al). If you actually want to show live editable HTML; there's some …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

This is a java question, not a javascript question.

There's a whole lot of difference between Java, and Javascript.

You'll probably have more luck in the Java forum

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You can't drop anything into the end user's 'real' toolbar (from a webpage). that would be outright rude.

If you mean something different; be specific.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

hmmm, i had a quick visit to your page (from that link) with cookies cleared and cookie notifications switched on. The first event is a request to set the style cookie to 'undefined':

This page wishes to set the cookie
   style="undefined"

This value will only be sent to documents on the server grafax.co.uk, and paths that are starting in /.

The cookie will be deleted when Opera is closed.
----------------------
Full cookie request:

style=undefined; path=/

So, that means the if(style==null || style='undefined') checks were probably correct... it's a bit weird that O_o. Go with a full test just in case:

<%@ LANGUAGE="JAVASCRIPT" %>
<% var style = new String(Request.Form('style'));
if(style==null || style=='undefined' || style==''){
  style = new String(Request.Cookies('style'));
  if(style==null || style=='undefined' || style==''){
   style="1";
  }
}else{
   Response.Cookies('style') = style;
}
%>

the line in blue is where you should define the default stylesheet's filename suffix, so a '1' will make the default sheet /styles/style_1.css.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

text-align:center; in CSS is an extremely easy replacement for center; in the way you just suggested. A div with text-align:center; works pretty much exactly the same as <center>. As such, there's no real need for <center> in modern HTML versions. I'd say <center> is more functionally obsolete than neccessarily deprecated for a good reason.

The problem is always aligning things to the vertical center =P You can do it using hacky absolute positioning tricks in CSS, using hacky style-overrides in JavaScript; or you can make a giant table and use a vertical-align:center; TD. Still. Giant tables don't always work properly in true DOCTYPE (X)HTML (1+)4+.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Oops; the problem is that that code is self-restricting.

Any value in the cookie overrides the value from the form; so, once you submit once, you can't submit again.

Corrected part: (ASP only)

<%@ LANGUAGE="JAVASCRIPT" %>
<% var style = new String(Request.[B]Form[/B]('style'));
if(style==null || style==''){
  style = new String(Request.[B]Cookies[/B]('style'));
  if(style==null || style==''){
   style="default";
  }
}[B]else{
   Response.Cookies('style') = style;
}[/B]
%>

Seems like a minor thing, but it'll make all the difference =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster
href="/styles/style_<%Response.write(style)%>.css"

This bit means it will be looking in the /styles/ folder for a file called style_[X].css, where [X] is the value submitted in the field named 'style' from the form/cookie.

I think there's a problem with the null-string checking aswell; in the two places where it says style=='undefined' try: style==''; so:

if(style==null || [B]style==''[/B]){
  style = new String(Request.Forms('style'));
  if(style==null || [B]style==''[/B]){
   style="default";
  }else{
   Response.Cookies('style') = style;
  }
}
MattEvans 473 Veteran Poster Team Colleague Featured Poster
The whole problem is that they won't keep things compatible.

We HAD a system where most web code was compatible. But then the elitists pounced, and decided that web code had to be more "elegant." Now we have a bifurcation between the newest browsers and the old ones.

There should be either a criminal penalty for introducing incompatibilities into a system that already works, or the person who introduced the incompatiblity should be forced to pay for the upgrade for everyone in the world.

Has that got absolutely anything to do with this post, or did you intend it (the reply) to go elsewhere?

But anyway, assuming this is meant here:

ASP code will always be self-compatible because it doesn't matter how old a version of ASP you have on your server. ASP spits out HTML; and it can be as up-to-date or back-in-time as you (as the developer) so choses, If you update your ASP version, you only affect yourself.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It's not so much incompatibility as unimplemented previously, or implemented to a lesser standard previously. It's not correct to expect older browsers to display things exactly as new browsers do; or even to work within the latest standards. For that; every browser would have to have been implemented with the ability to update and rewrite itself silently. A far better idea would be versioning...! wait a minute; that's what happens.

Development is certainly a good thing; unfortunately it's difficult to sit and wait for development to stop and be ready (i.e. everyone having it) because that's not really the nature of development.

Looking at a W3C page (first result in google for 'CSS3 date') shows it was scheduled to be conceptually complete by the end of 2000. Seven years later; 'modern' browsers are only just implementing the complete CSS2 spec. I'd say thats less an incompatiblity and more about what the impetus of new browser's development has been: I'd rather see well tested and correct CSS2 implementation than badly implemented CSS2 & 3. As it is, neither is really the case on any browser, but at least there are clear standards to aim for these days.

It would be bad, if using new standards made all pages inoperable under older standards. But that's very rarely the case. All HTML and CSS specs are quite backwards compatible (but certainly not pre-emptivly forwards compatible).

Anyone who releases information specifically for text only browsers makes an effort to release …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ah; sorry. These two blocks shouldn't be combined:

<%@ LANGUAGE="JAVASCRIPT" %>

<% var style = new String(Request.Cookies('style'));
if(style==null || style=='undefined'){
  style = new String(Request.Forms('style'));
  if(style==null || style=='undefined'){
   style="default";
  }else{
   Response.Cookies('style') = style;
  }
}
%>

You'll probably hit more errors now ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

To Q1; that's probably the most common way. There is another way; using IMPORT directives; but the way you've put will work fine.

To Q2, you don't need:

document.login.submit()

you just need to return true at the end of that handler function.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

QT is pretty common, it often gets installed as a subsidiary or requirement for another install.

I've never had much luck with finding good, free video recoding software... I certainly don't know of any Mac software.

I'd use a package like Ulead or even at a push Windows Movie Maker on the PC. They aren't recoders but they let you import files from multiple formats and export in multiple formats.

The kind thing you're looking for though; would probably come up under web searches for:

- Mac Video Encoding Software
- Mac Video Recoding Software
- Mac Video Conversion Software
- Mac Video Editing Software

MattEvans 473 Veteran Poster Team Colleague Featured Poster

MOV files should work on a PC. What happens if you take the MOV file and try to play it on a PC without embedding it on a page? That is, just copy it onto a PC and open it in Quicktime.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Is that really the best way to create the entire content of the page?

Perhaps it's not working because the elements you reference don't exist yet; or shouldn't exist atall. (document.write() breaks a rule in XHTML; Firefox is alot stricter about rules)

Perhaps; it'd work if you took all of the functions that attempt to change the elements that you create with document.write() (which may even be unaddressable by ID) and put them into a new function; which you call after the printHTML function.*

I'd really advise that you take as many of those document.write calls out as you can; make the majority of the page in HTML, and use JS HTML DOM methods if you must create or modify elements dynamically.

Otherwise; it's making your code incredibly difficult to manage and read; and difficult to know exactly how a browser/JS engine is going to interpret it.

*By after; I don't mean call the new function from within the printHTML function. I mean put them into a function called changeHTML for example; and putting this in body onload:

"printHTML();changeHTML();"
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Put something like this in the head of every page: (note: you only really need the bold part in the code of the page with the form/that changes the cookie)

<%
var style = new String(Request.Cookies('style'));
if(style==null || style=='undefined'){
  [B]style = new String(Request.Forms('style'));
  if(style==null || [/B][B]style=='undefined'){[/B]
   style="default";
  [B]}else{
   Response.Cookies('style') = style;
  }[/B]
}
%>
<link rel="stylesheet" type="text/css" href="/styles/style_<%Response.write(style)%>.css"/>

I can't really test that atall; I can't run ASP anywhere.

The principle will work but some of the keywords words might be wrong... (is it Form or Forms?/Cookie or Cookies?) Also; it's not very secure or input-safe. A better way would be to use a keyword/enumeration in the cookie and form, and set the style variable to one of a list of the only allowable values.

For that code to work you'll need to set Javascript as the script language.
(put this line before the code)

<%@ LANGUAGE="JAVASCRIPT" %>

It'd almost be the same with VBScript; although I don't know how you'd test for a null string...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Mm. IE is used by (maybe not most, but) a huuuuge subset of Internet users. I know for a fact that many of these users are either casual, very busy, or just unbothered by standards because the Internet works for them.

These people make up a sizeable chunk of the real 'consumers' on the Internet, and they're definately worth targetting.

IE7 seems alot more correct when it comes to rendering. It's a horrific interface though.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Single tags without closing tags or closing slashes are deprecated (a fancy word meaning they plan to discontinue it shortly).

That's not true. In HTML the close tag or closing slash for lots of elements is optional. Unclosed tags are just illegal in XML and thus XHTML.

http://www.w3.org/TR/html4/intro/sgmltut.html
http://www.w3.org/TR/html4/index/elements.html
http://www.w3.org/TR/xhtml1/#h-4.3

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Every page must pass XHTML 1.0 strict before they will enable it.

That's a bit OTT. XHTML Strict and HTML Strict are exactly as strict as each other, only in different ways. I think people like the X too much.

I bet these people don't even serve their pages as application/xml+html; thus losing a big benefit of XHTML, new stricter parsers that potentially needs less overhead than HTML parsers.

XHTML Strict isn't neccessarily the 'new' browser standard DTD anyway; there'll likely be an up-to-date HTML DTD until all of us are long gone...

You're right about the closure within the <br /> start tag; I don't like that rule; It implies <script> with src instead of body should be closed in the start tag; and I find that screws up on older MSIE browsers (it renders the whole page invisible)... Perhaps I was missing the space =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

For a textarea; try [object].text = "etc" rather than [object].innerHTML = "etc"...

I think that's the correct property; I'll get back to you on that..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I plan on learning to build web services using java. Can you tell me what softwares I need? Is the regular jdk 1.6.0 that I have installed sufficient? Or do I need a different version?

By the way I am trying follow instruction from a book and tomcat is installed twice in the book's example. First its installed in the home folder as a servlet !container! and then its installed in the /usr/local/ folder as a web server. Is this a typo? Should I follow these directions?

These questions will definately get better answers in the Java forum.

For the first one; it depends what kind of web application you're developing. You have the standard JDK which is fine for web-deployed desktop applications but not ideal because you need to create client-server pairs and/or get past security rules, You have the mobile device JDK (J2ME) which will probably be very web-orientated these days, and things like JSP for 'webpage applications' which you're probably considering if you want to use Tomcat...

For the second one; I imagine that the installation in a home directory is for a modifiable folder, and the installation in the /usr/ folder is for program binaries. Don't take that as an authoritative answer though... I haven't ever used JSP or Tomcat; I'm sure someone who has will be more helpful; and there's a large chance there'll be more of them watching the Java forum than the XML forum.

=)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ok, the main problem there; was with quoting - where you tried to put the cookie domain inside the cookie setting function directly you quoted it so that a load of the script became quoted (quoted parts in <script> tags are generally treated as text, or as an error). That's quite a weird construct (multiple ternary operations concatenated to generate the cookie string). It wasn't very neatly written either.

I've attached a copy of the file that works, and you can see it working at http://www.fusiongroups.net/cookie.html.

You gotta beware of those quotes:

"this is a "test" is a test" = illegal, and will probably crash the script.
"this 'is a 'test' is a test" = legal, even though there's an odd number of ' quotes
'this is a "test" is a test' = should be legal aswell.

"this is a \"test\" is a test" = legal because the \ character means 'treat the next character as text, even if it should do something special'

"this is a test' - illegal, and anything following that, until a " is reached will be treated as text, this will potentially crash the script unless there's an inverted error like this in exactly the right place.

check out:

http://www.quirksmode.org/js/strings.html

MattEvans 473 Veteran Poster Team Colleague Featured Poster

document.write() is a really horrible method. it's either invoked as a page is parsed (no scope for user interaction), or it dumps text into an arbitrary place in the document, in XHTML it's forbidden for another reason.

A better way to place arbitrary HTML at a defined place in a document is using methods like [HTMLObject].innerHTML.

<div id="test">

</div>

<input type="button" accesskey='$' value=' Sidenote ' onclick="placeHTML()" class="codebuttons' name='Sidenote' method="post"/>

<script type="text/javascript">
function placeHTML(){
  document.getElementById('test').innerHTML = '<span class="sidenote" title="Text"></span>';
}
</script>

There's a good reason why the HTML to write is NOT specified in the input onclick="" attribute; you run out of quoting levels far too easily (you have to enclose the event handler in quotes, and the function parameters in quotes, and the attributes in the HTML in quotes; and you can't place the same quote that surrounds a quoted block within that block without escaping it).

Also, it would make an illegal document in alot of cases because attributes shouldn't contain HTML < or > characters; some HTM: renderers would put the <span> element into the output directly, and assume that the surrounding <input> was malformed. True XHTML parsers would choke on it and show an error message instead of a page. Again, this could be got around by escaping; but that's quite messy.

Think about parameterizing the placeHTML function so that you have enough variety in what it can do, without needing the specify the entire output from onclick="" attributes.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

One way to get around this would be checking the requesting browser's identification and serving text-only pages for extremely old browsers.

It's a double workload if you have to make every page twice. A better way around would be designing the page so it can be interpretted logically without CSS styling; and making heavy use of CSS for the benefit of newer browsers, and then not serving the stylesheet to older browsers.

Do you want the older browsers to see modern effects? If I was on an 'outdated' system, I'd rather see well organised plain text than a half-styled or messed up page.

Adding the closing tags to closure-implicit HTML markup generally doesn't cause harm; one exception is <BR>, which is a line break whether its <BR> or </BR> even in XHTML.

Have you been having problems with lists being filled with 'doubles' where every other value is empty? If you code your pages with an HTML doctype; it's probably legal to use <LI> without a closure, and the same with <HR> and <IMG>.. With an XHTML doctype, it's certainly not.

Browsers that don't support CSS centering (the same applies for any CSS) wont be negatively affected by it, they'll just render as if the style wasn't applied. The worst thing is browsers that support the CSS halfway or incorrectly...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Ah, I should have been more specific there; it's not just important if a link has been visited; but also if data in and X virtual 'directories' below a current directory has been modified since a user last saw it.

I suppose cookies could work. I didn't really consider using them; I rate a site setting a new cookie more than a few times in a session as a large irrtatant (only because my browser's usually in a testing mode and asks me about every cookie a page tries to set).

I suppose (because my virtual directories are physical) that it would be quite alot simpler with cookies, good use of path/domain would mean much less need for classification at my end.. But indeed; it's not transferent between computers/browsers, and would generate a potentially huge amount of cookie data for my users...

My site uses a logging method already; at present every user has a file-vector into the folder representing their current location... I suppose it'd be simple (and fast per-request) to make those vectors leave persistant impressions. Limiting the persistance of information to the top X sublocations from a location would be ok aswell..

It seems quite a big planning task for something that on-the-face-of it seems simple.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

When you set that cookie, it will default to only be available to the subdomain of the page that set the cookie, and possibly only the folder that set that cookie.

A site-wide cookie should have:

Path = "/"
Domain = "yourdomain.tld" (without the www)

For persistance; set the date 100 years in the future and remember to update it if its about to expire XD

So, if you don't set the path and domain, that cookie might only be available to pages in the folder of the page that set the cookie.

Does the splash one-time only functionality work on the page that set the cookie? It is working ok on my server.

If you are entering code in one continuous line like it's coming up in your posts, it's not going to work unless you remove all the comments... (I'd advise putting the code back into different lines) The first time the javascript engine sees // it ignores all data until it reaches a line break...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You only need FTP access to write .htaccess files that can contain ModRewrite directives.... But they'll only work on an Apache server. Free hosting even on Apache might have all overrides disabled; which would prevent you using anything in .htaccess files.

You could probably implement an image protector using PHP... you have the same access to the server environment variables (which would let you detect who or what is accessing your images); but you'd have to do something messy like print images to the outputstream as binary data for a real protection. I did something like that a while back in Perl, it was for uploaded image validation rather than hotlink protection, but it used that principle..

You can't disable the view source button >_< Only a browser deliberately programmed with "invoke any annoying directive a web page asks me to" functionality would support that.

There are PHP image manipulation functions built into PHP.. For watermarking:

Take the basic image manipulation parts from here:
http://www.tutorialized.com/tutorial/A-Beginners-look-at-Image-Creation/11645

And combine them with the loadimagefromjpg function used here:
http://www.tutorialized.com/tutorial/Resizing-An-Image-Using-PHP/16806

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You're getting closer certainly; and from a parser's perspective that's pretty much exactly how a namespace works.

From a developers perspective, although the namespace does visually separate those nodes from the surrounding document, it's more that we're highlighting those nodes as being a specific grouping so that a parser could decide to treat them differently to how it may treat nodes in another (different) namespace.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I'll agree, IE6 is about the lowest common denominator that IE user's are gonna be visiting from. But IE6 is in no way perfect.

I really want to get some standardisation for definitions; this is what I take to be the meaning for the following terms:

- CSS Only Design = Doesn't exist
- CSS Design = Any design that makes use of cascading style sheets
- Tableless Design = Not a decision you can afford to take until a project is finished
- Design with less tables = A design approach minimizing the use of tables except in situations where they are appropriate, or more viable than any other solution.

There's no such thing as switching to CSS design for me. It doesn't register as a valid switch of anything. If a solution with floating/positioned/hierachal DIV elements to arrange a layout isn't doing what I want it to do, (on every appropriate browser), I instantly transform it into a table if a table would be appropriate. I wouldn't then dettach my CSS stylesheets in shame and clean my mind by headbutting the physical table beneath my keyboard.

I know the points where a DIV + CSS solution is probably going to fail, and avoid using DIVs + CSS in those situations. In my case; I guess that puts me off using 'correct' methods as a first choice in some cases. But, I'm lucky in that I don't work much in HTML directly; …