How to get previous page javascript [duplicate] - javascript

This question already has answers here:
How to get the previous URL in JavaScript?
(9 answers)
Closed 7 years ago.
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Succesfully Updated')
</SCRIPT>");
this is my code i want it to redirected in my previous page and had it refresh.

<script>
window.location = document.referrer;
</script>

Related

Location Reload Seting the page [duplicate]

This question already has answers here:
How do I redirect to another webpage?
(58 answers)
Closed 2 years ago.
I'm using location.reload in js but I wanna set the page a i wanna reload, this is my function
success: function (data) {
alert("Andamento concluido nos seguinte processos: " + data.ids_processos);
location.reload('/admin/carregamentop/index');
return false;
}
How can i set the page?
There are lots of methods to do this ,use what is most suitable for you
visit https://www.w3schools.com/jsref/obj_location.asp

how to redirect with jquery a page to another when a counter ends? [duplicate]

This question already has answers here:
How do I redirect to another webpage?
(58 answers)
Closed 4 years ago.
Hello programmers this is my question today, what function in jquery do i need so when a counter reach the number 100 that page is redirected to the main menu?
Check the counter's value with an if statement and if the value is 100, then simply:
window.location.href = 'http://example.com';
There is no need for JQuery in this.

JS code into PHP code [duplicate]

This question already has answers here:
What is the difference between client-side and server-side programming?
(3 answers)
Reference - What does this error mean in PHP?
(38 answers)
Closed 5 years ago.
I can not add JS code into PHP code
JavaScript File:
$.each(data.data,function(i,modul){
tb.append("<p><?php if (!is_dir($rootPath . '/Includes/'" + value.id+ "'")) { ?> <span>Test</span><?php } else { ?> <span>Test</span><?php } ?></p>"});
This line:
' + value.id+ ' = This is a JS code
Where do I make mistakes?
Thanks

how can i verified if a path exist or not [duplicate]

This question already has answers here:
PHP: How to check if image file exists?
(22 answers)
Closed 8 years ago.
I would like to test if a path like this file:///c:/folder/texts/int.txt is exist or not if it's exist i open it else echo"file doesn't exist" ,somone have any idea please?
Very short google search shows http://php.net/manual/en/function.file-exists.php
bool file_exists ( string $filename )

PHP $_Get and JQuery .load [duplicate]

This question already has answers here:
Encode URL in JavaScript
(22 answers)
Closed 8 years ago.
I want to load another page via Javascript like this
$("#resultarea").load("searchresults.php?searchstring=" + $("#searchbox").val());
in searchresults.php, a single statement
echo $_GET["searchstring"];
what I type in searchbox appears when searchresults.php is loaded except when I add space and another word, no thing appear at all. I heared it can be done by encoding or somewhat, I searched but didn't find a solution.
Try encodeURIComponent:
var encodedValue = encodeURIComponent($("#searchbox").val());
$("#resultarea").load("searchresults.php?searchstring=" + encodedValue);
Source
Demo

Categories

Resources