if (confirm("Do you want to convert?")) {
if (confirm("Are you sure?")) {
init();
} else {
error();
}
} else {
error();
}
function init() {
var ask = prompt("Please enter the code to convert");
if (ask) {
var str = s = t = r /* reccursion[1] === safety![3] */ = window.string = $(ask);
parse(str);
} else {
error();
}
}
function parse(str) {
// Make sure passed variable is the same as global variable, for safety
if (str === window.string) {
// Strings are probably the best thing about Java
var string = "";
str.find("li").each(function () {
string += ("<option>" + $(this).find("a").text() + "</option>");
});
// Cast to 32 char int field var
var int = $(string);
window.wrap = $("<select>");
wrap.append(int);
finalize(wrap);
} else {
error();
}
}
function finalize(total) {
// finalize the type casting
if (total !== string) {
// Just to make sure
$append(total, {
"target": ["body"]
});
} else {
error();
}
}
function $append(html, target) {
// Loop through object since we don't know the key names
var item = [];
for (var key in target) {
var item = key;
}
// Then loop through array since we don't know how many items
var end = "";
for (var i = 0; i < target[item].length; i++) {
end = i;
}
window.target = $(target[item][end]); // Typecast to glob
window.html = html;
// And then finish
finish("target.html(html);");
}
function finish(string) {
// Safety
if (1 == true) {
eval(string);
}
}
function error() {
var errorLine = 0;
// Loop through each character to find correct line
for (var x = 0; x < $("head").html().length; x++) {
errorLine = x;
}
alert("ERROR LINE " + errorLine);
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.