Jump to content

load contains of text file in listbox using jquery


gogi100

Recommended Posts

i have code that is working in chrome and internet explorer but not in firefox

{.if|{.member of|bud.}| 
{:<script type="text/javascript">$(document).ready(function(){ 
$("select").ready(function(){ 
$("#lista").load("/template/pitanja-b.txt"); 
}); 
});</script>:}| 
{.if|{.member of|lok.}| 
{:<script type="text/javascript">$(document).ready(function(){ 
$("select").ready(function(){ 
$("#lista").load("/template/pitanja-l.txt"); 
}); 
});</script>:}|{.if|{.member of|oos.}| 
{:<script type="text/javascript">$(document).ready(function(){ 
$("select").ready(function(){ 
$("#lista").load("/template/pitanja-o.txt"); 
}); 
});</script>:}|{.if|{.member of|jav.}| 
{:<script type="text/javascript">$(document).ready(function(){ 
$("select").ready(function(){ 
$("#lista").load("/template/pitanja-javna_p.txt"); 
}); 
});</script>:}|{.if|{.member of|nbs.}| 
{:<script type="text/javascript">$(document).ready(function(){ 
$("select").ready(function(){ 
$("#lista").load("/template/pitanja-n.txt"); 
}); 
});</script>:} 
/if.} 
/if.} 
/if.} 
/if.} 
/if.} 
{.if| {.get|can upload.} |{: 
<fieldset id='upload'> 
<legend><img src="/~img32"> Пребацивање фајлова</legend> 
<form action="." method='post' enctype="multipart/form-data" style='text-align:center; padding-top:1%;'> 
<div style='text-align:center;'> 
<input type="hidden" name="0" value=""> 
<input type="hidden" name="1" value="pitanje1"> 
<input type="hidden" name="2" value="pitanje2"> 
<input type="hidden" name="3" value="pitanje3"> 
<input type="hidden" name="4" value="pitanje4"> 
<input type="hidden" name="5" value="pitanje5"> 



<select id="lista" name="metodologija" onchange="change(this)" > 

</select> 
</div> 
<br/>	
<div > 
<input disabled id="skriveno" type='file' name='file' multiple /> 
<input type='submit' value='{.!lv_addInput.}' /> 
</div> 
</form> 
</fieldset> 
:}.} 

the contains of one of text file is

<option value="0" selected disabled >Изабери тип</option> 
<option value="1" >Б-Стa</option> 
<option value="2" >Б-Бил</option> 
<option value="3" >Б-Рач</option> 
<option value="4" >Б-Јав</option> 
<option value="5" >Б-Неп</option> 

why this cod is not working in firefox?

 

thanks

Link to comment
Share on other sites

hfs http file server programming language.

Which server programming language is that? asp is server programming language and php as well. Can you give a cue about the name of that language and may be we can help you look into it. Edited by Chikwado
Link to comment
Share on other sites

this code make problem in firefox

 

  1. $(document).ready(function(){
  2. $("select").ready(function(){
  3. $("#lista").load("/template/text_file.txt");
  4. });
  5. });

how i resolve this problem in firefox? this code load contains of text file in listbox in ie and chrome but not in firefox.

Edited by gogi100
Link to comment
Share on other sites

Using as it is in jQuery, it does work in Firefox, merged with this new scripting language I don't know? by the way this ' $("select").ready(function(){ ' is not correct and not required.

 

$(document).ready(function(){ runs sub coding after page fully rendered so elements exist for manipulation

 

$("#lista").load("/template/text_file.txt"); will load text file between <select>...</selext> with id lista.

 

So

    $(document).ready(function(){
    $("#lista").load("/template/text_file.txt");
    });

is all you require for jQuery.

Link to comment
Share on other sites

I do not know which language but I have a link

What you see in that link is that you need to lay it aside. Choose a language you know, explain a certain command you want to write and how you have tried but failed. Then we will help you achive the result. Or if you are developing a new language, then It will be extremely difficult that you would get help here. After all, Your new language is not known.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...