Path JS on the Startup Script

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mishanian
User
Posts: 120

Path JS on the Startup Script

Post by mishanian »

Hi,
I have leaseinfos page and on StartUp Script of View page, I wrote following script:

$(".CancelButton").click(function(){
	Title="Cancel";
	$('#MyModal').find('.modal-title').html(Title);
	ID=<?php echo $lease_id;?>;
    $.ajax({url: custom/cancel_lease.php", data: { id: ID }, success: function(result){
		$('#MyModal').find('.modal-body').html(result);
	}});

  }); //Click

the above code the following path:

leaseinfosview/custom/cancel_lease.php

but I would like to call (relative to root path)

custom/cancel_lease.php

if I add the following path, it works

../custom/cancel_lease.php

why I should add upper level .. ?


arbei
User
Posts: 9286

Post by arbei »

You better use absolute path starting with "/", e.g. /basepath/xxx.php, or use absolute path starting with "http://" or "https://".


Post Reply