am functioa urmatoare
function fetchData(url,dataToSend,objectID){
var pageRequest = false;
if (window.XMLHttpRequest) pageRequest = new XMLHttpRequest();
else if (window.ActiveXObject) pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
else return false;
if(!pageRequest){
alert("Browserul dumneavoastra nu suporta Ajax, aplicatia nu este functionala");
return false;
}
...................................
nu am postat tot codul....
...................................
problema mea apare la diferentierea dintre browsere si modul cum functioneaza site-ul respectiv.. in internet explorer totul este ok....
in mozilla firefox, in momentul cand navighez desi imi ramane in index.php (functioneaza corect adica) imi apare "un fel de refresh" si vreau sa scap de lucrul asta si sa pot sa fac site-ul functional precum in IE..."smooth navigation"
any ideea? de unde-ar fi problema cu navigarea?
navigare
Moderator: Moderatori
am datePage.php
/ building menu
if(isset($_POST["sendData"]))
{ $searchString = $_POST["sendData"];
$acasa=file_get_contents("acasa.php");
-----------etc vars----------
// $oferta=file_get_contents("oferta.php");
// $portofoliu=file_get_contents("portofoliu.php");
// $contact=file_get_contents("contact.php");
// $evaluare=file_get_contents("evaluare.php");
// $gratis=file_get_contents("gratis.php");
// $link=file_get_contents("link.php");
// $blog=file_get_contents("blog.php");
// $rzv=file_get_contents("rzv.php");
// $caredeoaspeti=file_get_contents("co.php");
if ($searchString == 1) {$dataResults = sprintf($acasa);}
elseif ($searchString == 2){ $dataResults = sprintf($oferta);}
elseif ($searchString == 3) { $dataResults = sprintf($portofoliu);}
----------------------------------------------------------- etc etc
}
// showing it in the div requested by ajax
echo $dataResults;
si index.php
<div id="site">
<div id="control" onclick="fetchData('dataPage.php',1,'message');"> Acasa</div>
----------etc----------------etc---------------etc--------
<div id="message" align="center"> </div>
</div>
precum su functia fetchData......
function fetchData(url,dataToSend,objectID){
var pageRequest = false;
if (window.XMLHttpRequest) pageRequest = new XMLHttpRequest();
else if (window.ActiveXObject) pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
else return false;
if(!pageRequest){
alert("Browserul dumneavoastra nu suporta Ajax, aplicatia nu este functionala");
return false;
}
pageRequest.onreadystatechange = function() {
var object = document.getElementById(objectID);
object.innerHTML = pageRequest.responseText;
}
if (dataToSend) {
var sendData = 'sendData=' + dataToSend;
pageRequest.open('POST',url,true);
pageRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
pageRequest.send(sendData);
}
else {
pageRequest.open('GET',url,true);
pageRequest.send(null);
}}
de ce apar diferente intre IE si MOzilla ... apare un flick in mozilla ... si in IE mie spre exemplu pe localhost.. nu imi merge insa unora le merge...
sunt putin nedumerit si nu gasesc explicatie
/ building menu
if(isset($_POST["sendData"]))
{ $searchString = $_POST["sendData"];
$acasa=file_get_contents("acasa.php");
-----------etc vars----------
// $oferta=file_get_contents("oferta.php");
// $portofoliu=file_get_contents("portofoliu.php");
// $contact=file_get_contents("contact.php");
// $evaluare=file_get_contents("evaluare.php");
// $gratis=file_get_contents("gratis.php");
// $link=file_get_contents("link.php");
// $blog=file_get_contents("blog.php");
// $rzv=file_get_contents("rzv.php");
// $caredeoaspeti=file_get_contents("co.php");
if ($searchString == 1) {$dataResults = sprintf($acasa);}
elseif ($searchString == 2){ $dataResults = sprintf($oferta);}
elseif ($searchString == 3) { $dataResults = sprintf($portofoliu);}
----------------------------------------------------------- etc etc
}
// showing it in the div requested by ajax
echo $dataResults;
si index.php
<div id="site">
<div id="control" onclick="fetchData('dataPage.php',1,'message');"> Acasa</div>
----------etc----------------etc---------------etc--------
<div id="message" align="center"> </div>
</div>
precum su functia fetchData......
function fetchData(url,dataToSend,objectID){
var pageRequest = false;
if (window.XMLHttpRequest) pageRequest = new XMLHttpRequest();
else if (window.ActiveXObject) pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
else return false;
if(!pageRequest){
alert("Browserul dumneavoastra nu suporta Ajax, aplicatia nu este functionala");
return false;
}
pageRequest.onreadystatechange = function() {
var object = document.getElementById(objectID);
object.innerHTML = pageRequest.responseText;
}
if (dataToSend) {
var sendData = 'sendData=' + dataToSend;
pageRequest.open('POST',url,true);
pageRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
pageRequest.send(sendData);
}
else {
pageRequest.open('GET',url,true);
pageRequest.send(null);
}}
de ce apar diferente intre IE si MOzilla ... apare un flick in mozilla ... si in IE mie spre exemplu pe localhost.. nu imi merge insa unora le merge...
sunt putin nedumerit si nu gasesc explicatie
"Nothing has such power to broaden the mind as the ability to investigate systematically and truly all that comes under thy observation in life. "
Înapoi la “Librarii Javascript”
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 11 vizitatori