HighDots Forums  

Re: Ajax ed Internet Explorer: Errore da mal di testa

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss Re: Ajax ed Internet Explorer: Errore da mal di testa in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Max M.
 
Posts: n/a

Default Re: Ajax ed Internet Explorer: Errore da mal di testa - 12-21-2007 , 01:01 AM






Ivan Marcialis wrote:
Quote:
var text = xmlhttp.responseText;

eval(callback+"(text)");
eval( callback + "(" + text + ")" );

M



Reply With Quote
  #2  
Old   
Max M.
 
Posts: n/a

Default Re: Ajax ed Internet Explorer: Errore da mal di testa - 12-21-2007 , 03:40 AM






Ivan Marcialis wrote:
Quote:
On 21 Dic, 08:01, "Max M." <ed... (AT) maxim (DOT) comm2000.it> wrote:
Ivan Marcialis wrote:

var text = xmlhttp.responseText;
eval(callback+"(text)");
con questo codice l'errore che mi da e':
previsto identificatore stringa o nomero
Avevi detto che il server restituiva codice Javascript, percò ho pensato che
volessi inserirlo nell'eval. Ovviamente se text non contiene un'espressione
Javascript, il mio suggerimento è sbagliato.

Ma se devi semplicemente invocare una funzione passando il testo restituto
dal server, perché usi un eval? Invoca direttamente la funzione passando
text come primo argomento. Qual è il problema? Ovviamente, 'callback' dovrà
essere un riferimento a una funzione, non una stringa con il *nome* di una
funzione.

Max






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.