Refresh periodically server data without page refreshing [closed] - html

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
This is the issue. I am making social networking website and I want to display online/offline user status without refreshing page. I have everything done in Mysql, online status is displayed on page, but without refreshing page changes in online status are not registered. So basically I supose that it could be solved with AJAX request. I want to get changes in mysql query and to display it directly on page without page refreshing.

A couple of different options, but two that I will highlight:
1) jQuery. Straightforward JavaScript library way to asynchronously access the user data as you specify. AJAX calls are built in by design. See http://api.jquery.com/jquery.ajax/. This is pretty much out of the box functionality, and easier to implement if you're crunched for time.
2) If you're totally new to getting back end data into the front end, and refreshing on the fly, I might suggest you choose a more recently designed JavaScript framework, such as AngularJS. This would give structure to the front end of your application. The only real drawbacks for this are learning curve (higher than jQuery) and SEO, as it is a fully JavaScript-driven output. For SEO, there is a well-known workaround: http://www.yearofmoo.com/2012/11/angularjs-and-seo.html.
Hope this high level overview helps put you on the right track...

Related

Is it possible to use 1 html file to view different items on different pages? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am currently in the process of creating a website for a small enterprise. I made a nav item called "Collections" where it is divided into various categories for the type of products that will be sold (Rings, Bracelets etc). And then Under "Rings" (when selected), multiple items that can be bought are displayed in a gallery form (image + a "click here for more details"just below). When you select an individual item, a new page (target="_blank") will open that will display price/description of said selected item.
Since in the future, there will probably be hundreds of items with their price/descriptions, should i make an individual html file for each? Or is there a way to have 1 html file and a new page opening depending on which item was selected?
Since you're looking at creating an e-commerce site and needing help on the simpler bits then I would suggest that you look into using a dedicated hosted e-commerce platform such as Shopify, Squarespace or if you want to self host Magento or Prestashop.
This is because once money is involved, rolling your own platform when you're not an expert isn't a great idea.
There's a post here: https://www.upwork.com/hiring/for-clients/self-hosted-vs-hosted-e-commerce-platforms-right/ which could help you decide what is best for you.
I believe you are looking for single page application, since you are building an e-commerce website there would be click events to show product description.creating individual page for each product is time consuming.From your question i believe you want load the product details on the same page which can be achieved by loading data from your back end and implementing a templating system in the front end.
have a look at
https://angular.io/

When to use AngularJS? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I want to develop a website by my own. I want to make different web applications which need to interact with databases. I read about AngularJS, a JavaScript framework. The thing I do not understand is: When to use AngularJS? Do I first build my website in HTML & CSS and then add functionality to it with AngularJS? How do professional developers start with that?
Thanks.
When you want:
A single page app
A RESTFUL app
Flexibility of the front end and Ultimate separation of both front and back end
And you should stay away from it when:
you have low budget as you will need both front and backend engineers. Most times, backend engineers can bring up your site without worrying too much about various stuffs Javascript has to offer.
If mobile users are you main target developing HTML5 Mobile application. I prefer Backbone instead (Yes backbone)because Angular makes my phone extremely hot and drains battery like hell.
Angular js is a javascript frame work which will run at client side.
It will reduce no. of http calls to the server.
Lot of server side executions can be done at the client side itself.
Page loading is faster.
Mainly used for single page applications.
Used to write modular and re-usable code.
If you want to create some kind of social interaction site which have likes, comments, posts etc in that scenario Angular js is best choice.
You can use Angular js along with lot of server side languages like Php, Asp .net etc.

How do I create a website template using html and css? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Maybe I'm not using the correct terminology because I can't seem to find an appropriate answer. I have built a header and a footer using html and css. This will not change from page to page and so I want to make it the template and simply change the content in between the header and the footer for each page of my website. I know I could simply copy and paste the code but if I wanted to change the header for some reason I would then have to change the header on each of my pages! Super inefficient. Coding is all about reuse. surely there's a way to do what I'm saying. Help me web developers!
You could do one of many things:
Use PHP files and require() the headers and footers in the main page, though you'll have to use a server on your localhost to test the pages.
You could maybe take a look into creating single page applications, using AJAX.
AJAX Introduction here.
You could go a step further and pick one of the very popular JavaScript MVC frameworks.
Read more about them here.
Finally, you could also do it the "old way" and use iframes, but that is honestly bad practice and will bring more harm than good.

Creating Website - Full Control [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What is the best/most common way to create a website for a business? I would like to do the programming my self, and I don't want to do something like wordpress given the lack of full control. I've tried googling answers to this but all I find is sites recommending Wix or Wordpress. I've used Visual Studio in the past for ASP.NET, but I'd like to hear from someone with more knowledge.
My goal is to make a site would involve users being able to sign up and post results they have found, and although it sounds like something a cookie cuter forum model could handle there are some features that I don't see being able to handled by things like Wordpress or Wix.
"there are some features that I don't see being able to handled by things like Wordpress "
Not sure where you got this information from, but with a wordpress.org site, you can add or delete anything you want from a wordpress theme. All you need to do is create a child theme based on the parent theme you select and you can edit the child theme to your liking.
For more info, check this out creatingchildthemes
If you haven't installed WordPress yet, I made an easy tutorial marvelmoe.com/wordpress
One way you can do this is to make it on GitHub, by creating a repository and coding it there. Then,you can get a custom URL from GoDaddy. Then you will have a site. This is what I did to make my site, and it worked perfectly.

Optimize HTML page with a TON of links [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I maintain an HTML page that contains a list of links to photo galleries. Over the past few years it has gone from a small page to a list that contains HUNDREDS of links. My fear is that it has affected the SEO of the page as a whole; being interpeted by spiders as a link farm. Of course, I have no real way of knowing fo sure but I have started to suspect.
Is there an efficient simple way to deal with a large number of links in a manner that is still easy for the user to browse? While having hundreds of links one of top of the other may not be the best looking method, its easy to search since they are all in chronological order. I am looking to figure out a way that I can keep the page simple without creating more of a maintenance nightmare for myself.
One idea I had was use XML to store the links and use some kind of dropdown so that when a spider hit the page it would not see a mountain of links, just a reference to XML
Use a "pager" script to show, say 10 at a time. They are available in every web framework or you could quickly hack up your own.
... how about this. Put links in separate file(s) (or somehow store them outside of the page, db, flat file, etc.) and load them via ajax call as needed. Say, something like 'Category A' button, when clicked loads links into a div. That should keep it out view for spiders.
Then there's this: http://www.robotstxt.org/meta.html and this: http://en.wikipedia.org/wiki/Nofollow