e mi macheranno le ultimeOriginariamente inviato da daniele_dll
su windows le librerie vengono caricate in questa sequenza:
- cartella di avvio del software
- variabile $PATH![]()
e mi macheranno le ultimeOriginariamente inviato da daniele_dll
su windows le librerie vengono caricate in questa sequenza:
- cartella di avvio del software
- variabile $PATH![]()
mi sa che è una leggenda quella del JS non testabile dagli stand alone, perchè come ti ho detto io e ri-confermato daniele, la libreria JS per ogni versione è presente e caricata negli stand alone.Originariamente inviato da andrea.paiola
e mi macheranno le ultime![]()
Fai questo semplicissimo test con IE5 o 4 che sia ....
var mioarray = [];
mioarray.push("testo");
alert(mioarray[0]);
dovrebbe già andarti in errore.
[OT_giachecisono]
come si fa il push in IE4 o 5 ? così:
[/OT_giachecisono]codice:if(![].push) { Array.prototype.push = function() { var a = 0, b = arguments.length; while(a < b) this[this.length] = arguments[a++]; }; }; var mioarray = []; mioarray.push("testo"); alert(mioarray[0]);
![]()
Mi va in errore anche col 6Originariamente inviato da andr3a
Fai questo semplicissimo test con IE5 o 4 che sia ....
var mioarray = [];
mioarray.push("testo");
alert(mioarray[0]);
dovrebbe già andarti in errore.
ps: ma devo aprirlo direttamente? o devo lincarlo in una pagina?![]()
:ahem: mancherebbe il return lengthOriginariamente inviato da andr3a
mi sa che è una leggenda quella del JS non testabile dagli stand alone, perchè come ti ho detto io e ri-confermato daniele, la libreria JS per ogni versione è presente e caricata negli stand alone.
Fai questo semplicissimo test con IE5 o 4 che sia ....
var mioarray = [];
mioarray.push("testo");
alert(mioarray[0]);
dovrebbe già andarti in errore.
[OT_giachecisono]
come si fa il push in IE4 o 5 ? così:
[/OT_giachecisono]codice:if(![].push) { Array.prototype.push = function() { var a = 0, b = arguments.length; while(a < b) this[this.length] = arguments[a++]; }; }; var mioarray = []; mioarray.push("testo"); alert(mioarray[0]);
![]()
preso da cssQuerycodice:// for IE5.0 if (![].push) Array.prototype.push = function() { for (var i = 0; i < arguments.length; i++) { this[this.length] = arguments[i]; } return this.length; };![]()
azz ... non so cosa sia cssQuery, cmq non ottimizza una favaOriginariamente inviato da kentaromiura
preso da cssQuery![]()
![]()
questa direi che dovrebbe andare altrettanto bene ed è sicuramente più veloce
http://www.devpro.it/code/115.html
[edit]
che bello aver ribollito l'acqua
http://www.faqts.com/knowledge_base/....phtml?id=7405
mannaggia a me e a quando non cerco![]()
![]()
ragazzi... nn mi insultate... ma ho un problema con IE...
help me perchè sto sclerando...
allora... dalla pagina regioni.php seleziono la regione e voglio che nella stessa pagina
mi appaiano le province delle regione selezionata...
esempio :
seleziono veneto...
e mi appaiono per magia venezia, treviso, padova etc etc...
tutto questo con ajax...
porco giuda!!!! con firefox mi funziona con IE no!!!!
da regione.php....
leggo un elabora.php che appunto contine l'output xml delle provincie...
IMPORTANTE!!!!
SE SULLA FUNZIONA
function fnc1 ( vedere codice js ) al posto di elabora.php metto il elabora.xml
( sono la stessa identica cosa )
funziona!!!
vi posto i codici delle due pagine....
REGIONI.PHP
<HTML>
<HEAD>
<script language="JavaScript" type="text/JavaScript">
var ResultTxt;
var ResultXml;
var ResultXml1;
var strResponseXml;
// The var docForm should be a reference to a <form>
function formData2QueryString(docForm) {
var submitContent = '';
var formElem;
var lastElemName = '';
for (i = 0; i < docForm.elements.length; i++) {
formElem = docForm.elements[i];
switch (formElem.type) {
// Text fields, hidden form elements
case 'text':
case 'hidden':
case 'password':
case 'textarea':
case 'select-one':
submitContent += formElem.name + '=' + escape(formElem.value) + '&'
break;
// Radio buttons
case 'radio':
if (formElem.checked) {
submitContent += formElem.name + '=' + escape(formElem.value) + '&'
}
break;
// Checkboxes
case 'checkbox':
if (formElem.checked) {
// Continuing multiple, same-name checkboxes
if (formElem.name == lastElemName) {
// Strip of end ampersand if there is one
if (submitContent.lastIndexOf('&') == submitContent.length-1) {
submitContent = submitContent.substr(0, submitContent.length - 1);
}
// Append value as comma-delimited string
submitContent += ',' + escape(formElem.value);
}
else {
submitContent += formElem.name + '=' + escape(formElem.value);
}
submitContent += '&';
lastElemName = formElem.name;
}
break;
}
}
// Remove trailing separator
submitContent = submitContent.substr(0, submitContent.length - 1);
return submitContent;
}
function xmlhttpPost(strURL, strSubmit) {
var xmlHttpReq = false;
// Mozilla/Safari
if (window.XMLHttpRequest) {
xmlHttpReq = new XMLHttpRequest();
xmlHttpReq.overrideMimeType('text/xml');
}
// IE
else if (window.ActiveXObject) {
try{
xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e){
try{
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){}
}
}
// POST ----
//xmlHttpReq.open('POST', strURL, true);
//xmlHttpReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
// GET -----
xmlHttpReq.open('GET', strURL, true);
// REQUEST -----
xmlHttpReq.onreadystatechange = function() {
if (xmlHttpReq.readyState == 4) {
strResponse = xmlHttpReq.responseText;
strResponseXml = xmlHttpReq.responseXML;
switch (xmlHttpReq.status) {
// Page-not-found error
case 404:
alert('Error: Not Found. The requested URL ' + strURL + ' could not be found.');
break;
// Display results in a full window for server-side errors
case 500:
handleErrFullPage(strResponse);
break;
default:
// Call JS alert for custom error or debug messages
if (strResponse.indexOf('Error:') > -1 ||
strResponse.indexOf('Debug:') > -1) {
alert("Errore=",strResponse);
}
// Call the desired result function
else {
if(xmlHttpReq.responseXML!=null) //&& xmlHttpReq.responseXML.documentElement!=null)
{
strResultFunc(strResponseXml);
}
else {
alert('Errore nessun risultato da visualizzare' );
}
}
break;
}
}
}
xmlHttpReq.send(strSubmit);
}
function handleErrFullPage(strIn) {
var errorWin;
// Create new window and display error
try {
errorWin = window.open('', 'errorWin');
errorWin.document.body.innerHTML = strIn;
}
// If pop-up gets blocked, inform user
catch(e) {
alert('An error occurred, but the error message cannot be' +
' displayed because of your browser\'s pop-up blocker.\n' +
'Please allow pop-ups from this Web site.');
}
}
function strResultFunc(XMLFile){
var a = 0;
var OpzioniSl,lunghinfo1;
var MyForm = document.forms['AnagrIns'];
OpzioniSl = MyForm.ProvinciaSel;
// - -DEBUG- - //
//alert(XMLFile.getElementsByTagName('root')[0].getElementsByTagName('record')[3].firstChild.nodeValue)
// - FINE DEBUG - //
//Aggiunge opzioni alla lista
lunghinfo1 = XMLFile.getElementsByTagName('root')[0].getElementsByTagName('record').length;
for (var i=0; i<lunghinfo1;i++)
{
OpzioniSl.options[a] = new Option(XMLFile.getElementsByTagName('root')[0].getElementsByTagName('record')[i].firstChild.nodeValue,i);
a++;
}
OpzioniSl.selectIndex = 0;
}
function fnc1 (myform,myrif){
var strPage;
var valueInfo;
var xml = null;
//valueInfo = formData2QueryString(myrif)
//valueInfo = formData2QueryString(myrif)
strPage = 'elabora.php'; //'http://gabriele/invent/elabora.php?regione=' + myrif;
// alert(strPage);
xmlhttpPost(strPage,null,strResultFunc);
}
</script>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>TEST AJAX</TITLE>
</HEAD>
<BODY>
<?php
//connessione database test
include ("funzioni.php");
test();
?>
</p>
<table border="0" width="517" bgcolor="#E3E3FF">
<tr>
<td width="50%"><font face="Arial" size="1" color="#FFFFFF">Username :
<? echo $username; ?></font></td>
<td width="50%"><font face="Arial" size="1" color="#FFFFFF">Data : <? echo
$data; ?></font></td>
</tr>
</table>
<table border="0" width="517" height="184" bgcolor="#E9E9E9">
<tr>
<td width="893" height="184" valign="top" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#E9E9E9">
<font size="1" face="Arial">
[img]img/quadro1.bmp[/img] MODULO
INSERIMENTO REGIONI - TEST PER AJAX </font>
<form id="AnagrIns">
<p align="left" style="word-spacing: -1">
<font face="Arial" size="1">REGIONE :
<select name="regione" id="regione" onChange="fnc1('AnagrIns',this.selectedIndex)" style="font-family: Arial; font-size: 8 pt; font-weight: bold" size="1">
<option value=""> seleziona regione </option>
<?php
$reg = mysql_query ("select distinct grp_id,regione from regioni") or die (mysql_error());
while ($row = mysql_fetch_array ($reg))
{
$id = $row[grp_id];
$regione = $row[regione];
echo '<option value='.$id.'>'.$row[regione].'</option>';
}
echo "</select>";
?></font>
<p align="left" style="word-spacing: -1">
<font face="Arial" size="1">PROVINCIE:
<select name="ProvinciaSel" id="ProvinciaSel" style="font-family: Arial; font-size: 8 pt; font-weight: bold" size="1">
</select>
</font>
</form>
[/b]
</td>
</tr>
</table>
</BODY>
</HTML>
ELABORA.PHP
<?php
$connessione = mysql_connect("localhost","root","") or die("Connessione fallita");
mysql_select_db("test") or die ( "Impossibile selezionare $dbname" ) ;
$idregione = "1";
$prov= mysql_query("select * from regioni where grp_id = '$idregione'") or die (mysql_error());
$str="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$str.="<root>";
while ($row=mysql_fetch_assoc($prov))
{
$str .="<record>".$row['provincia']."</record>";
}
$str .="\r\n";
$str .="</root>";
echo $str;
/**
* poi alla fine del ciclo apri il tuo file e ci scrivi dentro $str.
* il file ovviamente deve stare in una cartella che abbia i
* permessi di scrittura, alla fine chiuderai il file
*/
$handle=fopen("file.xml", "w+");
if (!fwrite($handle,$str))
die("si è verificato un errore durante la scrittura");
fclose($handle);
?>
OUTPUT SUL BROWSER IE DI ELABORA.PHP
<?xml version="1.0" encoding="UTF-8" ?>
- <root>
<record>treviso</record>
<record>venezia</record>
<record>vicenza</record>
<record>verona</record>
<record>belluno</record>
<record>rovigo</record>
<record>padova</record>
</root>