Jump to content
php.lv forumi

holly cow vai javascript load php content


anonīms

Recommended Posts

adrese: www.adrese.com - viss ok

adrese: www.adrese.com/register/ - slikti. (izmantots tiek mode_rewrite)

jquery + http://paste.php.lv/d4710ff5b70fe2682b965dd7f08d90ce/nonum

	

					<ul>
						<li id="NHLtournaments"><a href="#" onclick="look_in_tournamentsList('NHL');">NHL</a></li>
						<li id="FIFAtournaments"onclick="look_in_tournamentsList('FIFA');"><a href="#">FIFA</a></li>
						<li id="NBAtournaments"><a href="#" onclick="look_in_tournamentsList('NBA');">NBA</a></li>
						<li id="TOPSPINtournaments"><a href="#" onclick="look_in_tournamentsList('TOPSPIN');">TOPSPIN</a></li>
						<li id="USERStournaments"><a href="#" onclick="look_in_tournamentsList('USERS');">LIETOTAJU</a></li>
					</ul>
...		
<!-- sta of lookup tournaments -->
<div id="look_in_tournamentsList">
	<? include"scripts/look_in_tournamentsList.php"; ?>
</div>
<!-- end of lookup tournaments -->

 

spiežot un kādas knopkas iekšš adrese.com viss ir ok, bet tiklīdz ir papildus lapa adrese.com/lapa/ tā tur, kur vajadzētu mainīties kontentam, parādas pilnīgi jauna lapa.

Piemērs - http://bildites.lv/images/08zj95iw5j0knws4amo4.jpg

Edited by anonīms
Link to comment
Share on other sites

Pārrakstot urli ar mod_rewrite, browseris redz lapu kā "citā direktorijā", tātad, ceļi jānorāda absolūti, nevis relatīvi.

 

$("#look_in_tournamentsList").load("public/scripts/look_in_tournamentsList.php?content="+key+"");

 

Tur vajag piemest priekšā "/", lai ceļš ir absolūts..

 

Tavā gadījumā pārlūks meklē to failu: http://www.adrese.lv/lapa/public/...

Ja piemet ceļa priekšā slešu, tad viņš meklēs iekš http://www.adrese.lv/public/...

Edited by briedis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...