Jump to content
php.lv forumi

jQuery un rewrite engine kļūda


dAivEd

Recommended Posts

Sveiki!

 

Nesen pamaniju ļoti lielu kļudu taisot jaunu mājaslapu

 

.htaccess pierakstiju

 

Options +FollowSymlinks
Options All -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ([^/]+)/?$ /?page=$1 [L,QSA]

 

Lai linki izskātās smukāki teiksim nevis www.site.com?page=contacts bet www.site.com/contacts

 

Kontents mājaslapa ielādejās caur jQuery sekojoši (ielādēju caur jQuery jo vajag lai katru laiku atjaunojas jaunumi galvenāja lapa):

 

<div id="content"><img src="/spinner.gif" alt="" style="display: block; margin: 0 auto;" /></div>
<script type="text/javascript">
function refresh_stats()
{
 $.get(
	"pages/news.php",
       function(returned_data) {
		$('#content').html(returned_data);
		window.setTimeout(refresh_stats, 15000);
       }
);
}
$(document).ready(function(){
	refresh_stats();
});
</script>

 

rakstot www.site.com/contacts/newform (ieliekot uzstādijumus iekš .htaccess) vai rakstot www.site.com/contacts/ Man tas jQuery takā ieciklējas viņš tajā <div id=content> atver velreiz manu pilnu lapu, un taja lapa pa vidu velreiz lapu utt. Varbūt spečuki zin kas pa lietam un kas man nepareizi ? :/

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...