Hello,
In web development should we do more processing on client side (javascript) or server side (PHP) ?
15 1380
that entirely depends on what you aim to do.
after all you wouldn't use a screwdriver to bang in a nail, when you have a hammer in arms reach!
what I mean is, PHP and javascript are quite different beasts, as a rule of thumb, aesthetic code (DHTML etc) is handled by JS everything else is PHP IMHO
Hello,
In web development should we do more processing on client side (javascript) or server side (PHP) ?
That depends upon what processing it is.
If your page has to find product of two numbers, then do that in JavaScript. PHP would give slow response in that case.
If your page adds or fetches some data to the database, use PHP. JavaScript alone won't do anything.
Hello,
In web development should we do more processing on client side (javascript) or server side (PHP) ?
Using just one or the other isn't possible.
Use must learn to utilise both these languages.
A PHP programmer will have mostly server side, with some client side. A javascript programmer will do the opposite. You ultimately will need to know both, but almost certainly more of one than the other. Most of us here use PHP more, but other people will use Javascript more. My advice, choose one and jump into it and you will see if you like it. Regardless of if you do, learn a bit of the other so you know what the alternative is. But start with one (your choice).
In case of Ajax what should be the choice ?
I started out learning PHP and making my application basically without Javascript, but as I learned Javascript more and more, and found I needed more and more client side dynamics, I have incorporated it more and more. Now Javascript is an essential part of my work.
I am the only one working on my application projects, which is a very exciting adventure, because I do both the front and back end programming. Coordinations (like setting up meetings with myself) is a piece of cake, and the programmer on both front and back ends (me) knows exactly what the other wants ;) But because of this I have had the pleasure of learning both PHP and Javascript (and much more).
But I have not yet taken the plunge to using Ajax. I am using what I suppose came before Ajax was developed, by putting a hidden iframe in the page and using Javascript in the main page and iframe to do whatever background work I need without refreshing the main page, and changing elements in the main page dynamically as needed. I believe Ajax lets you do this a bit more elegantly, but my way works for me.
...........
But I have not yet taken the plunge to using Ajax. I am using what I suppose came before Ajax was developed, by putting a hidden iframe in the page and using Javascript in the main page and iframe to do whatever background work I need without refreshing the main page, and changing elements in the main page dynamically as needed. I believe Ajax lets you do this a bit more elegantly, but my way works for me.
Thats fine but I still didn't get the answer.
Thats fine but I still didn't get the answer.
What i think is of course client side javascript is faster, so if the case that
we can use client side javascript, then use it, always client side javascript first
so it can make your site run faster.
Hello,
In web development should we do more processing on client side (javascript) or server side (PHP) ?
It depends on the framework u use
if u use struts the validation can be done mostly on server side
by using the struts validaion
So if we have nay validation techniques its beter to use the serverside
Ajax is JS and PHP combined.
I guess I didn't give you really an answer to your question. To use PHP or Javascript depends on what you are needing to do with/on the particular page.
I use Javascript when I want some decision to be performed on the client side without needing to first contact the server where the PHP is running. This could be to do many tasks, here are some examples:
1) Determine which button that the user pressed, telling the server PHP scripts what to do next (I do not use multiple forms on my pages, just one form and I use Javascript to tell the server where to go next).
2) Submit an iframe to perform a background query without doing a complete new page request (Ajax stuff). This may be because I just wish to update some fields based on user selection, or to avoid rebuilding a page which is time consuming to produce or download.
3) Open up auxiliary windows to show stuff (popup windows).
4) Provide dynamics on the page according to user interactions.
All of the above cannot be done on the server side, at least not efficiently, and so are done on the client side using Javascript.
For user input validations, I do this sometimes on the client side with Javascript, but mostly on the server side after the page was submitted using PHP.
Ajax is JS and PHP combined.
The AJAX (=asynchronous JavaScript and XML) technique is server-side agnostic. It could just as well be running Java on the server.
For user input validations, I do this sometimes on the client side with Javascript, but mostly on the server side after the page was submitted using PHP.
Unless you completely trust your clients (hi, grandma!) you must validate input on the server-side even if you're already doing client-side validation (for good validation response).
Atli 5,058
Expert 4TB
I tend to avoid Javascript as much as I can. Mostly because Javascript is run on the clients browser, and can therefore be turned of or mutilated in other ways.
With PHP I know it will never be bypassed or executed incorrectly by the browser. It is simply more reliable that way.
Comparing AJAX and PHP is completely useless. They are nothing alike... It's like comparing a car to a spaceship... just doesn't make sense.
The AJAX (=asynchronous JavaScript and XML) technique is server-side agnostic. It could just as well be running Java on the server.
My apologies - I was considering what the OP had spoken of: PHP and Js.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |