Wie zu erkennen, ob Bespannbild mit JavaScript enthält:erkennen, ob Bespannbild enthält
1. string1='Lorem'; string2="foo";
2. do nothing;
3. string1='ipsum'; string2="foo";
4. string1='dolor'; string2="foo1";
5. do nothing;
6. do nothing;
7. do nothing;
...
Dies wäre ein Teil des Skripts:
1. input="[Lorem]foo";
2. input="[ ]";
3. input="[ipsum]foo";
4. input="[dolor]foo1";
5. input="[sit ]foo2";
6. input="[ amet]foo3";
7. input="amet]foo3";
...
Script input
auf diese Weise verarbeitet werden soll ...
input = "[asd]qwe";
input2 = "qwe";
processit(input);
processit(input2);
function processit(e){
if(..???..){
alert(string1);
alert(string2);
}
else {
return false;
}
}
Vielen Dank für Ihre Zeit.
EDIT: Lösung muss Cross-Browser
IE7 +
Firefox 3.6+
Chrome 7+ ...
Eine Art schwer zu sehen, was scheint das Problem zu sein! Wenn Sie Informationen über Regular Expression - [MDN RegEx] (https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions) und eine [RegEx-Site zugewiesene Site benötigen (http://www.regular-expressions.org). info/javascript.html) – Bakudan