2

Being comfortable with Javascript, HTML5, and CSS3, allows me to achieve most anything I want to accomplish in a given design, however removing Javascript from the equation leaves little to offer in terms of dynamic content. Being that some users prefer to disable JavaScript, albeit this is exception rather than the norm, in such use cases, are there any alternative technologies that would (could) not be disabled, and thus allow for workaround-dynamic content to still be present in the absence of Javascript?

In order to satisfy these requirements the following criteria would have to be met:

(1) The technology has cross-browser compatibility with (nearly) all modern browsers.

(2) The technology would need to allow for user input on the website (such as text fields), which would then be sent sever-side for processing, then return data (such as a chunk of HTML).

(3) Then, this technology would also need to be able to take this chunk of HTML/data and add it to the page without a refresh (ideally, though a refresh my be able to be tolerated if necessary).

Doing my own due diligence, I have come up with part of an answer, though I am not sure about the feasibility of my approach, and thus would like to hear what you think about using server-sided scripting (like PHP) and HTTP-META-REFRESH, to achieve such a result.

Does such an approach sound feasible, or is PHP-scripting on the server side also have the ability to (going out on a limb here) be turned off by the user as well? If it can be turned off, furthermore, are there any other ways to send and receive data that can't be (or has a much less likelihood of being) turned off, then use this data to change the HTML of a given page similar to the way the "document.getElementById(id).innerHTML = new HTML" approach?

4
  • Realistically speaking, a dynamic site almost requires Javascript. Refreshing the page does not solve the problem. Sure it's okay for users to disable Javascript, but that doesn't mean they still get the same experience. Commented Jul 17, 2015 at 3:39
  • Your three points can be covered by a simple HTML / CSS / PHP combination if you're willing to settle on the page having to refresh in point 3. No meta refreshes or anything necessary Commented Jul 17, 2015 at 3:49
  • What about if I only used the HTTP-META-REFRESH on an image, say an SVG, would this be possible without having to refresh the entire page? Commented Jul 17, 2015 at 4:25
  • Also, would it be accurate to say that using an HTML / CSS / JAVA servlet combination would be equivalent to a simple HTML / CSS / PHP combination respective to this need? Commented Jul 17, 2015 at 4:30

1 Answer 1

4

Server-side languages like PHP cannot be "turned off" by the user.

Using "http-meta-refresh" is not relevant. You cannot use that to simulate in any way the interactivity of JavaScript. It might meet point 1 (browser availability) but it has nothing to do with points 2 and 3.

Specifically, it cannot be used to issue POST requests (point 2) and doing a meta refresh refreshes the page. It misses point 3 entirely.

There is no way of achieving JavaScript-like functionality such that it cannot be turned off and works in all browsers. There is nothing remotely like this.

Sign up to request clarification or add additional context in comments.

9 Comments

According to codymanix on the page "stackoverflow.com/questions/2386602/ajax-without-javascript" he said, "You can also use server sided scripting like PHP and then use HTTP-META-REFRESH to refresh your page, this can in some cases simulate cases where you would have used JavaScript otherwise". Is this incorrect?
@NateNeuhaus No, it can simulate some cases, specifically a very, very narrow set of cases in which you would have used JavaScript to automatically perform a full page refresh. But again, this is fully reloading the page, which is something you seem not to want. It would also reload the page on a timed interval, regardless of whether the user has started or finished filling in fields.
I see, so after I received the new data back, following up with a meta refresh, wouldn't update the page with the new data?
@NateNeuhaus That's all wrong. You don't "receive the new data back", the entire page is reloaded. You can't use meta-refresh to selectively submit data or reload parts of the page.
Also, instead of using PHP, per se, could I instead use a JAVA based servlet for server-side processing, with the same guarantee that "it could not be turned off"?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.