Jump to content
php.lv forumi
  • 0

Houston, I have a problem!


sandis_m

Question

index.php :

<script type="text/javascript" src="this.js"></script>

<a href="javascript:;" onclick="load_gb(); return false;">GuestBook</a>

<a href="javascript:;" onclick="load_about(); return false;">AboutMe</a>

<div id="content"></div>

 

this.js :

function load_gb() {
$("#content").html('<img style="background-position: center;" src="http://heal.lv/style/web_images/spinner.gif">');
$("#content").load("datagb.php");
}
function load_about() {
$("#content").html('<img style="background-position: center;" src="http://heal.lv/style/web_images/spinner.gif">');
$("#content").load("dataabout.php");
}

 

Kad es uzspiežu uz 'GuestBook', viss ir OK, bet kad uz 'AboutMe' - nekas nenotiek.

Kāda varētu būt problēma?

Es izmēģināju katru funkciju ielikt citā .js un tad aizgāja, bet man vajag vienā...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Kāda varētu būt problēma?
Problēma tāda, ka nepieciešams debugot savu uzrakstīto kodu, līdz nonāc līdz problēmai.

Da kaut pievieno iekš load_about funkcijas alert('about'); un paskaties, vai tik tālu viss darbojas.

Atver dataabout.php pa taisno pārlūkā un pārbaudi, vai tam vispār ir kāds saturs.

Atkomentē

//$("#content").load("dataabout.php");

un pārbaudi, vai spinner.gif tiek parādīts.

utt.

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
Answer this question...

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