korbaach It's always good to hear compliments!
[quote:1d8lj9gm]is it possible to load javascript file in runtime?
Yes it is possible to load at runtime, but it takes a few seconds to be ready to use.
[quote:1d8lj9gm]
...because if I Ajax to load html & I use Properties bar to load .js
sometimes browser alert error...
What is the error message? Is it some browser protection? Is there an error in the Node-Webkit preview?
korbaach thank you for answering christ59 questions! I would not have done better.
********************************************************
christ59 sorry for the delay but I see that you received an excellent help.
You don't need to load two .js files. They are universal scripts that will work with all objects within Construct 2.
You need to modify the textarea ID. ID's are unique.
var output = document.getElementById('output');
////////////////////
// Quote ID 1
var quote1 = document.getElementById('quote1');
quote1.addEventListener('mouseup', function() {
if (this.selectionStart != this.selectionEnd) {
var selectedtext = this.value.substring(this.selectionStart, this.selectionEnd);
document.getElementById('output').value = selectedtext;
};
}, false);
////////////////////
// Quote ID 2
var quote2 = document.getElementById('quote2');
quote2.addEventListener('mouseup', function() {
if (this.selectionStart != this.selectionEnd) {
var selectedtext = this.value.substring(this.selectionStart, this.selectionEnd);
document.getElementById('output').value = selectedtext;
};
}, false);
[/code:1d8lj9gm]
[url=https://dl.dropbox.com/s/odkbpuls3ajtsb6/selectCopy%20%5BPlayLive%5D.capx]Download[/url]