Answer the question
In order to leave comments, you need to log in
How to form url (path) in JS script?
I work with open server.
Part of the autocomplete.php script code
$("#autocomplete_search_box").keyup(function(){
$.ajax({type: "POST",url: "<?php echo $autocomplete['script_path'].'?box_number=1'; ?>",
.............................
$autocomplete['script_path']='common/autocomplete/select_data.php'; //url: относительно файла, куда будет включен текст скрипта autocomplete.php
include ($_SERVER['DOCUMENT_ROOT'].'/common/autocomplete/autocomplete.php'); //а вот и включение/инклуд скрипта
......
$.ajax({type: "POST",url: "<?php $_SERVER['DOCUMENT_ROOT'].'/common/autocomplete/autocomplete.php?box_number=1'; ?>",
.............................
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question