Change URL Website without Load Page (Javascript)

  Рет қаралды 50,721

Luyện Thi Nhanh

Luyện Thi Nhanh

Күн бұрын

Change URL Website without Load Page (Javascript)
Time: 2min
-- Please Subscriber Me, Thanks you! --
Demo Link: luyenthinhanh.c...
Download source: luyenthinhanh.c...
- More Learning:
luyenthinhanh.com
- Note:you should prepare page or redirect url for each items link change, If not, when you F5 website will error 404.

Пікірлер: 45
@bot_fx6823
@bot_fx6823 Жыл бұрын
6 years after and this is still super helpful, thanks a lot man 🔥
@luyenthinhanh7319
@luyenthinhanh7319 Жыл бұрын
Thank you! I know it's not the best but it's the simplest, if you need more advanced, please contact me!
@luyenthinhanh7319
@luyenthinhanh7319 6 жыл бұрын
I have updated the code for easier viewing, please download file and view demo here: Demo Link: luyenthinhanh.com/website/changeUrl/change-url.html Download source: luyenthinhanh.com/website/changeUrl/demo_change_url.rar If have any question, please notice for me. Thanks.
@otete3020
@otete3020 4 жыл бұрын
Thank you! It helped me a lot😊
@XALXOMUSIC
@XALXOMUSIC 5 жыл бұрын
Thanks man
@ChathurangaBasnayakeCSB
@ChathurangaBasnayakeCSB 7 жыл бұрын
thank you :)
@michaelrapp12
@michaelrapp12 6 жыл бұрын
What is that song in the video, the first song played.
@Legend-ru5sf
@Legend-ru5sf 3 жыл бұрын
thanks bro
@avinashthakur1374
@avinashthakur1374 4 жыл бұрын
source cod does not work why u do like this ?
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
It's work when using true case, please sent me link u test source not work, I can check it now.
@alexlytle089
@alexlytle089 4 жыл бұрын
how can i use the pop state so I can use the back button on the browser
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
They are working not same. I think you should choose angular js or vue js, they are strong solution for single page.
@alexlytle089
@alexlytle089 4 жыл бұрын
@@luyenthinhanh7319 please there has to be a way
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
@@alexlytle089 I'll create demo using angular, if you need soon.
@alexlytle089
@alexlytle089 4 жыл бұрын
@@luyenthinhanh7319 that would be amazing! Thank you so much. I would really appreciate. It would mean so much
@alexlytle089
@alexlytle089 4 жыл бұрын
@@luyenthinhanh7319 I'm really looking forward to it
@luyenthinhanh7319
@luyenthinhanh7319 7 жыл бұрын
Home Page - if you want change title website, you have var title='name-site' // DEFAULT CONTENT var DOMAIN_NAME = 'luyenthinhanh.com/website/changeUrl/change-url.html'; var html_home = 'HOME PAGE'; html_home += 'Add content home page here!'; html_home += 'Any question or Task, Please Contact with me: luyenthinhanh.contact@gmail.com!'; var html_product = 'PRODUCTS PAGE'; html_product += 'Add content Products page here!'; html_product += 'Any question or Task, Please Contact with me: luyenthinhanh.contact@gmail.com!'; function loadHomepage() { history.pushState({},"",DOMAIN_NAME + "/home"); document.getElementById('main-content').innerHTML = html_home; } function loadProducts() { history.pushState({},"",DOMAIN_NAME + "/products"); document.getElementById('main-content').innerHTML = html_product; } Home Page - Test now Contact Page Products
@luyenthinhanh7319
@luyenthinhanh7319 6 жыл бұрын
Sorry ans your question late. you can put anywhere in url. can You give me before and after url you want? thanks!
@jorgea.garzav4650
@jorgea.garzav4650 5 жыл бұрын
It wont work as its expected, urls pile up and contents don't respond to the url change
@luyenthinhanh7319
@luyenthinhanh7319 5 жыл бұрын
Thank your comments. You need using url full and using Json load data when change url.
@anselminos5238
@anselminos5238 5 жыл бұрын
instead of history.pushState({}, "", "page/anotherPage"); you do this history.pushState({}, "", "/page/anotherPage"); You welcome!
@srinivasbalam3335
@srinivasbalam3335 4 жыл бұрын
Please send me the source
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
I have provide link download in description article. Hope It can help your requirement.
@pinyin1
@pinyin1 4 жыл бұрын
it can not redirect to new page or file eg profile.php
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
Please description detail case you want work.
@anselminos5238
@anselminos5238 5 жыл бұрын
doesnt explain much but if you think about what every thing does you'll understand
@aleksjudd2124
@aleksjudd2124 5 жыл бұрын
What software is this
@luyenthinhanh7319
@luyenthinhanh7319 5 жыл бұрын
Its JavaScript normal, you can using angular or framework JavaScript other, its easy implement.
@RajeshSoni-fr9ej
@RajeshSoni-fr9ej 4 жыл бұрын
Need help
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
Hi Soni, what do you need help?
@RajeshSoni-fr9ej
@RajeshSoni-fr9ej 4 жыл бұрын
@@luyenthinhanh7319 email
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
@@RajeshSoni-fr9ej luyenthinhanh.contact@gmail.com
@RajeshSoni-fr9ej
@RajeshSoni-fr9ej 4 жыл бұрын
@@luyenthinhanh7319 ok
@luyenthinhanh7319
@luyenthinhanh7319 4 жыл бұрын
@@RajeshSoni-fr9ej i can't see anything your letter?? Do you send to me?
@developeraccount438
@developeraccount438 5 жыл бұрын
this is not good method .
@luyenthinhanh7319
@luyenthinhanh7319 5 жыл бұрын
You need change logic matching requirements of customer. Or you can sharing requirement, i ll change it.
@developeraccount438
@developeraccount438 5 жыл бұрын
@@luyenthinhanh7319 I want to load page instead text.
@luyenthinhanh7319
@luyenthinhanh7319 5 жыл бұрын
@@developeraccount438 yes, you need have some route mapping url you want change. If end use refresh site, system will load content same curent page.
@developeraccount438
@developeraccount438 5 жыл бұрын
@@luyenthinhanh7319 may i have the pastebin or jsfiddle
@luyenthinhanh7319
@luyenthinhanh7319 5 жыл бұрын
@@developeraccount438 , please description about requirement, i and more persons very happy if help to you. :)
Junior Vs Senior Code - How To Write Better Code
22:13
Web Dev Simplified
Рет қаралды 1,1 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 54 МЛН
WORLD BEST MAGIC SECRETS
00:50
MasomkaMagic
Рет қаралды 43 МЛН
Поветкин заставил себя уважать!
01:00
МИНУС БАЛЛ
Рет қаралды 4,7 МЛН
iPhone 16 / 16 Pro Unboxing - Testing every new feature!
21:40
Mrwhosetheboss
Рет қаралды 2,7 МЛН
Wordpress vs coding - why devs SHOULD learn Wordpress
11:03
SuperSimpleDev
Рет қаралды 304 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
pushState and popstate
12:02
GeekLaunch
Рет қаралды 46 М.
Bootstrap 5 + PHP Tutorial | Make Your Website Dynamic
23:01
CogniVis AI
Рет қаралды 56 М.
Load More Data on Page Scroll using Ajax Jquery PHP
12:56
Webslesson
Рет қаралды 40 М.
Vanilla JS Single Page Application Routes | # or URL  - #88
33:38
JavaScript History API Basics
20:43
Codecourse
Рет қаралды 23 М.
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 54 МЛН