Jump to content

Recommended Posts

My PHP web application works fine with XP but people with Vista have problems with it. Javascript does not work. I don't have Vista and have no way to test. I said to add to "trusted sites" list but that didn't help.

 

The application doesn't have any buttons but anchor tags. For each the href is: "javascript:docommand('whatever');" The docommand javascript function accepts a single argument, stuffs that into a hidden text box, then submits the form. Everything always goes back to the original page, and if another page should be displayed, redirection is done, and the same continues on that page.

 

When people with Vista display a page and click a link, nothing happens. Help would be appreciated. Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/169989-solved-vista-problems/
Share on other sites

My PHP web application works fine with XP but people with Vista have problems with it. Javascript does not work. I don't have Vista and have no way to test. I said to add to "trusted sites" list but that didn't help.

 

The application doesn't have any buttons but anchor tags. For each the href is: "javascript:docommand('whatever');" The docommand javascript function accepts a single argument, stuffs that into a hidden text box, then submits the form. Everything always goes back to the original page, and if another page should be displayed, redirection is done, and the same continues on that page.

 

When people with Vista display a page and click a link, nothing happens. Help would be appreciated. Thanks

 

 

Need code or a link to the site.  Despite our many talents, telepathy isn't among them.

I was the webmaster of the site but gave it away, and the appearance changed, so that is not mine. Since then I put some PHP on the site. The problem application can be found at:  http://www.spfldcycling.org/miles/om_login.php .

 

The problem seems fairly straightforward. Javascript doesn't work for everyone. I assume the people who are having problems use IE. Basic FF does not block javascript, and if they did install FF and change it, they'd have enough sense to know why the application doesn't work. Two people contacted me with the same problem and knowing them, I'm sure they use IE, because they use the machine exactly as it comes out of the box.

 

I would post the PHP code, but that seems pointless, because the problem is with HTML that's not functioning properly in the client. That HTML can be seen by looking at the page source. I can post the PHP code, but would have to include three files.

 

My pages do not contain line feeds in the page source, so the source may be difficult to read. If I have a simple href "javascript:docommand('whatever');" on an anchor, that should work if javascript is enabled. What more is there? I've checked the page on the client side for syntax errors by turning on script errors in IE, though I have XP.

 

I'm thinking Vista has a new setting or something, that XP does not have, and therefore javascript is not working. Thank you for entreating me.

 

Without having access to a computer/environment with the problem, the only thing I can suggest is making sure everything validates, and improving the JS.  (Specially how it's called.... href="javascript:" is typically a bad way to go about it....  onclick is better.)

I think I have this fixed. The problem was IE8 and not Vista, but Vista of course has IE8. I have IE8 on my XP machine but I guess did not have it configured so as to create errors. Adding the following meta tag in the header solves everything:

 

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

 

Why the meta tag and not a doctype? According to the flowchart at http://blogs.msdn.com/giorgio/archive/2009/02/16/ie8-meta-tag-site-compatible.aspx , the doctype offers no guarantee of anything. If a doctype was used, the meta tag would still be needed to force use of the most current IE engine. Also, telling IE to use "edge" is the only certain course to the most current IE engine. Other browsers default to the current engine when there is no doctype. Only IE does not. For standard HTML a doctype should not be used to obtain the best compatibility for all browsers, but the IE meta tag should always be used.

 

After using the IE meta tag on my page, it did begin throwing a javascript error with debugging turned on. I got rid of the error. I still don't know why my IE8 was working and some others were not, prior to use of the tag. The error I saw only came to exist because of strict mode, caused by presence of the tag, which wasn't the case before.

 

I will continue making my pages without a doctype, but will from now on always include the IE meta tag, too.

 

Mate, I'd like to see something somewhere that shows any proof whatsoever that you shouldn't use a doctype for cross-browser compatibility. I can believe that IE may need something extra - it's IE and they always do everything their own way. But all the other browsers use the doctype, and in fact need it if you want valid code.

 

In the meantime, feel free not to use one yourself, but you should stop counseling others to do so until you can actually show that you know what you are talking about, since it goes against what everyone else is saying.

 

Looking at that link you provided, it shows that with a doctype, IE8 goes into standards mode, which is what all other browsers also do. That's why it's called a standard.

Hi MATE. How are you?

 

The point is, all browsers except IE use the most current standard. Until IE8, IE would also use what was current. Using the meta tag tells IE to use what's current.

 

When a DOCTYPE is used, the browser is forced to figure out what set of rules and what may or may not work. Browsers work differently and implement differently. Without a DOCTYPE a page is not locked to anything and the latest technology is always used.

 

The only time a DOCTYPE is needed and should be used is when a page is being made with very narrow scope and must implement a subset of the standard.

 

Just because I say something different than you does not make what I say invalid, nor does it give you cause to use strong language to make your point. People can look it up and read about it like I have done.

 

As is appropriate in this forum, I posted my solution so my problem can be shown to be solved.

 

Taken from http://wiki.whatwg.org/wiki/FAQ#Under_what_conditions_should_a_DOCTYPE_be_used_in_XHTML.3F . There are many references, but this one is worded well. Words at the bottom are most significant.

 

 

  Will (X)HTML 5 finally put an end to the XHTML as text/html debate?

 

Yes. Unlike HTML 4.01 and XHTML 1.0, the choice of HTML or XHTML is solely dependent upon the choice of MIME type, rather than the DOCTYPE. See HTML vs. XHTML

What will the DOCTYPE be?

 

In HTML:

 

<!DOCTYPE html>

 

In XHTML: no DOCTYPE is required and its use is generally unnecessary. However, you may use one if you want (see the following question). Note that the above is well-formed XML and so it may also appear in XHTML documents.

 

For compatibility with legacy producers designed for outputting HTML, but which are unable to easily output the above DOCTYPE, this alternative legacy-compat version may be used instead.

 

<!DOCTYPE html SYSTEM "about:legacy-compat">.

 

Note that this is not intended for dealing with any compatibility issues with legacy browsers. It is meant for legacy authoring tools only.

 

Excluding the string "about:legacy-compat", the DOCTYPE is case insensitive in HTML. In XHTML, it is case sensitive and must be either of the two variants given above. For this reason, the DOCTYPEs given above are recommended to be used over other case variants, such as <!DOCTYPE HTML> or <!doctype html>.

 

These alternatives were chosen because they meet the following criteria:

 

    * They trigger standards mode in all current and all relevant legacy browsers.

    * They are well-formed in XML and can appear in XHTML documents.

    * It is possible to output at least one of the alternatives, if not both, with extant markup generators.

    * They intentionally contain no language version identifier so the DOCTYPE will remain usable for all future revisions of HTML.

    * The first is short and memorable to encourage its use.

    * The legacy-compat DOCTYPE is intentionally unattractive and self descriptive of purpose to discourage unnecessary use.

 

Under what conditions should a DOCTYPE be used in XHTML?

 

Generally, the use of a DOCTYPE in XHTML is unnecessary. However, there are cases where inclusion of a DOCTYPE is a reasonable thing to do:

 

  1. The document is intended to be a polyglot document that may be served as both HTML or XHTML.

  2. You wish to declare entity references for use within the document. Note that most browsers only read the internal subset and do not retrieve external entities. (This is not compatible with HTML, and thus not suitable for polyglot documents.)

  3. You wish to use a custom DTD for DTD-based validation. But take note of what's wrong with DTDs.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.