How to replace URL when page is refreshed? - ajax

I am using ajax to reload just the #content on my page and pushing a fake /#pagename to the history. I want to be able to reset or replace the url to index.html when the page is refreshed because currently when you refresh, it messes everything up because it is trying to refresh url/#pagename which doesn't exist.
Here is what I have:
window.onunload=function(){
window.location.assign("url");
};

Related

Pagination navigation is not working inside iframe

In this website everything is working fine,
but when we load the website in a iframe then the everything is working but the pagination is not working.
Main Website: https://dropflo.thrivedeskdocs.com/en
Inside Iframe: https://iframetester.com/?url=https://dropflo.thrivedeskdocs.com/en
Recreate the issue: Go to the iframetester url, then go to "Getting started page" then scroll down to bottom, click page no 2. The page will not change.
There seems to be an issue with your URL generation.
The URL in your pagination links uses http instead of https.
Be sure to set your APP_URL .env variable to the correct URL, with the correct scheme:
// .env
APP_URL=https://dropflo.thrivedeskdocs.com
If that alone does not work (though it should, after clearing your configuration cache) try adding the following line to your AppServiceProvider:
\URL::forceSchema('https');
It may be a good idea to set it inside a conditional so that it only runs on certain environments. Maybe something like this:
if (parse_url(config('app.url', 'http://localhost'), PHP_URL_SCHEME) == 'https') {
\URL::forceSchema('https');
}
On a related note, you should also make your page automatically redirect any http requests to the https version of the same request.
https://growhackscale.com/blog/301-redirect-http-https

How to navigate to URL without full reload using page.js?

I want to redirect the user after submitting a form without reloading the page (document).
I tried,
page("./newurl/18/meetings");
When I click on a link link it works as expected.
Finally found out. It simply reloads the page when using a relative link with a leading dot.
This will reload
page("./mypath/subpath");
This will work properly
page("/mypath/subpath");

Create redirect to Edit page need to force reload

I created a Create page which upload a csv file then redirect to Edit.
The API is processes the File and add CSV fields list to the entry.
The problem is when I hit Save and get redirected to Edit, the Edit page does not have the Fields input in record prop.
Reloading the page I'm redirected force the reload so I can see the Fields.
I wonder If I can force the API reload when redirecting?
Found the solution...
I just need to process record fields as if they could be undefined.
So that way the Edit page will show and then be refreshed with the API replied record.

How to rewrite PHP wesite url?

my website url is : http://localhost/kubas/?page=home or
http://localhost/kubas/index.php?page=home
I want to make http://localhost/kubas/home how to do that?
Remeber that the browser automatically looks for the INDEX page.
It would appear that your "home" is being pulled from another source, and being dynamically inserted into the INDEX page
If you want the HOME page to load without using the $_GET function to pull your home page "content", you will need to manually insert all of the HOME PAGE content into the INDEX.php page, from there you will need to insert the index page e.g. (index.php) into your HOME..."FOLDER".
The browser will then go to HOME folder, look for INDEX.php and vioala!

wordpress: how to force a form fill before going to a page?

I am building a wordpress site with this requirement: when the user attempts to navigate to certain pages, they will be forced to fill out a small form (enter their email address) before they can get to the desired page.
On a standalone site, I'd do it like this: on each "protected" page, I'd look for a cookie named "email". If this cookie doesn't exist, redirect to an email capture page, along with a url parameter indicating the page to go to after they enter their email. The email form would call a PHP script that would set the "email" cookie, then redirect to the desired page
How to do this in wordpress? Would I create my cookie testing code in a template and assign that to the protected pages?
Create a template and page for your php code and when user try to navigate to protected pages check for cookie if doesnt exist go to email page (instead it would be fine if the form appears in a pop up window).There when you get the email onsubmit use ajax to go create cookie from php page and once the cookie is set the navigation should take place .you should create a template for the php page ,and give the page id in ajax code
I hope this is what u r looking for.

Resources