Pregunta

I have been able to make Ace save files and open files. I just need to make it dynamically change its mode based on the value of a <select><option> Kinda deal. This would complete everything I want to do with ace. I have save, and open commands as well.

Is there anyway to do something like this?

I have tried pulling the value of an option and I get the proper value, but it doesn't update the language mode. I have tried using jQuery, JavaScript, and i have tried everything I could find within the ACE API.

If you need code just let me know.

This JSFiddle is the best example of what I have. It still isn't fully done. I still can't get the code to work right. This is the script I am currently running with the page.

function run() {
    document.getElementById("src").value 
        = document.getElementById("language").value;
}

function up() {
    if (document.getElementById("src").value != "") {
        var changeval = document.getElementById("src").value;
    }

    newOption = document.createElement('p');
    newOption.id = changeval;
    newOption.value = changeval;
    pop(dop);
}

function pop(changeval2) {
    alert(changeval2);
}
¿Fue útil?

Solución

ace kitchen-sink demo does this see code here

Otros consejos

So as an update, I solved this problem by using my brain and what "a user" had said.

I found out that they use jquery to update the language on the change of the option.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top