Random number maker - javascript

I have a problem with my code . I want to make a program that generates random numbers and multiplies them by 50 then adds 30 to them then removes the remaining decimals.
I also want to show how these number are calculated by using <h1> tags.
after the equal symbol I want to show the final number that is multiplied by 50 and added by 30 and the decimals are removed.
<html>
<head>
<meta charset="UTF-8"/>
<title>Random Numbers</title>
<script>
function start(){
var num1 = Math.random();
var num2 = Math.random();
var num3 = Math.random();
var num4 = Math.random();
var num5 = Math.random();
var num11 = num1.toFixed(3);
var num22 = num2.toFixed(3);
var num33 = num3.toFixed(3);
var num44 = num4.toFixed(3);
var num55 = num5.toFixed(3);
/*var num111 = (num11 * 50);
var num222 = (num22 * 50);
var num333 = (num33 * 50);
var num444 = (num44 * 50);
var num555 = (num55 * 50);
/* ----------------------------------------------
var num111 = (num11) += 30;
var num222 = (num22) += 30;
var num333 = (num33) += 30;
var num444 = (num44) += 30;
var num555 = (num55) += 30;*/
document.getElementById("show1").innerHTML=num11 + '×' + '50' + '+' + '30' + '=' + num11;
document.getElementById("show2").innerHTML=num22 + '×' + '50' + '+' + '30' + '=' + num22;
document.getElementById("show3").innerHTML=num33 + '×' + '50' + '+' + '30' + '=' + num33;
document.getElementById("show4").innerHTML=num44 + '×' + '50' + '+' + '30' + '=' + num44;
document.getElementById("show5").innerHTML=num55 + '×' + '50' + '+' + '30' + '=' + num55;
}
</script>
</head>
<body>
<button id="btn" onclick="start()">Press the button</button><br/>
<h1 id="show1"></h1>
<h1 id="show2"></h1>
<h1 id="show3"></h1>
<h1 id="show4"></h1>
<h1 id="show5"></h1>
</body>

Check this: http://jsfiddle.net/wc5wnby5/2/
Probably you need to do like below:
document.getElementById("show1").innerHTML=num11 + '×' + '50' + '+' + '30' + '=' + Math.round(num11*50+30);
document.getElementById("show2").innerHTML=num22 + '×' + '50' + '+' + '30' + '=' + Math.round(num22*50+30);
document.getElementById("show3").innerHTML=num33 + '×' + '50' + '+' + '30' + '=' + Math.round(num33*50+30);
document.getElementById("show4").innerHTML=num44 + '×' + '50' + '+' + '30' + '=' + (num44*50+30);
document.getElementById("show5").innerHTML=num55 + '×' + '50' + '+' + '30' + '=' + Math.round(num55*50+30);

Use Math.round() for removing decimal part. Consider following code:
document.getElementById("show1").innerHTML=num11 + '×' + '50' + '+' + '30' + '=' + Math.round(num11*50+30);
document.getElementById("show2").innerHTML=num22 + '×' + '50' + '+' + '30' + '=' + Math.round(num22*50+30);
document.getElementById("show3").innerHTML=num33 + '×' + '50' + '+' + '30' + '=' + Math.round(num33*50+30);
document.getElementById("show4").innerHTML=num44 + '×' + '50' + '+' + '30' + '=' + Math.round(num44*50+30);
document.getElementById("show5").innerHTML=num55 + '×' + '50' + '+' + '30' + '=' + Math.round(num55*50+30);
DEMO
Reference for more details.

If i right understood your problem:
function print(elemID, text){
document.getElementById(elemID).appendChild(document.createTextNode(text));
}
var res;
print('show1', (res = Math.random()));
print('show2', (res = res * 50));
print('show3', (res += 30));
print('show4', (res = res.toFixed(0)));
fiddle

Related

Why I can't play the MP3 Base64 string neither way?

Here are all the code:
// jQuery is loaded already
var s = 'data:audio/mp3;base64,UQzAwAAAAAfdlRSQ0sAAAAEAAAAMTA5VENPUAAAAAUAAADJwbDJV1hYWAAAABAAAAAAd3d3LmZsYXNoOC5uZXRUSVQyAAAAGAAAANW+s6TL2LLEKHNjLmNoaW5hei5jb20pQ09NTQAAABwAAABjaGkA1b6zpMvYssQoc2MuY2hpbmF6LmNvbSlUQUxCAAAAGAAAANW+s6TL2LLEKHNjLmNoaW5hei5jb20pVFlFUgAAABgAAADVvrOky9iyxChzYy5jaGluYXouY29tKVRDT04AAAAYAAAA1b6zpMvYssQoc2MuY2hpbmF6LmNvbSlUUEUxAAAAGAAAANW+s6TL2LLEKHNjLmNoaW5hei5jb20pAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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kTITUWaPTv//////////////AAJIAA+/vwfb+zf8hFf/yKev/587l//xY5RY4wv//8cQcdjuT///7o2Rnb/////////////////////4AAQBABCErBNw+YzIPYlwSf/7kmQIAAPmkFk2ZEAAQjIL0MaIAAyZT1z9oYAJbhcrw7ZgAa+1upB96gkGWd2x1yFKrCzsjCjPhYQIwNEIh1cwKGKBhxmMZV0OGeYAYK6M1CFeUyl1kOxHU6h7FWUqlMCDjuzvdmYwQruhTGM/pKYQj9qo1/TZ6GuZXlfaQ7dXs2iszb2t//////////////8d4yxyA/aCSCet1I8n7O/5CHIn+YosWSjL/dwCV66f5G2OS//+gNzXdFSX//5TN/////92//////////////////4ggACS7YJX0YdYJtWmxSafaS6nY1fx59XEtaMp669Izr5M8LhnSLXFrsylFhFsQxGf0rllr596ecmtNTVvIml8vz7T95g4VdTRgwyrS7y2bdCuxtQAW2yMHBe2BU2Y0ize3flstXLPAWWGkIskxSpMPu/UQ7SvrS6lOESb0LhtLRp/vef0tdDsOdyPioJqkUOmKzPuMh+7VLy+Y8+d/yfO2tEcmrBhsGEP11N2ryXaEy4EEgpv////wvfda7u/7v4AEAAz0rRGI4MhUU1+08P/+5JEBwDCvTDWq2kyYFNEipFt40oLGP9fTQxrgVWa6UHEGXByyKOCwaNT5yUN6vuSKV1XhrWwfakLhjnpsuaKPl2heyScCOzwqcZu/x+3et/9/v/M9KiQFh0Vc0yt1qRgVDosLKcaZodZupWwsEzCkTirrk5gGAz3QLQXX6DKLaft3nitt9atGvAgsuN/DaYWae2squMoCFFJUKcKGVRqeDgbS4k3OgIiUEowChVrRE6tL9xJALA4tKWVsr9pY6RQEoAIIKUttyAALAB0G2/NNBtfUKruAGdBFlTqm2U4c1NnHU5p8OMGeVNJVz1ibcVlvbDlL+9+Q50nuZrAZIRaoiaw3mT4WGgsKGhEdDD3peG2GarywUO7OLWE3zC0rBURMHgtS1oD4vzEV6uNAAvIoSMeMmhGhNh7qhK6FjnpWHmG6JIhsdHmJliTZbVNcm7nqI/bdf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Oky9iyxChzYy5jaGluYXouY29tKSAgICAgAG0M';
// failed 1
var a = $('<audio>');
a.attr('src', s);
try{
console.log(a[0])
a[0].play();
}catch(e){console.log(e)}
// failed 2
var sound = new Audio(s)
sound.play();
The both ways are failed. Is there anything wrong with my code?
Thanks,
Your MP3 data is invalid. If you decode the base64 data and load the result in your browser, I doubt you'll hear anything.
If you replace the data with something valid, then it should work. Here's an example:
var s = 'data:audio/mp3;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' +
'AAAAAAAWGluZwAAAA8AAAA4AAAp9QACBQUHBwoKDxMTGBgcHCAgJSkpLi4yMjY7Oz8/RERKS' +
'lBVVVpaYGBlZWpvb3R0eXl+goKHh4uLkJCUmpqenqOjp6essbG1tbq6v8TEyMjNzdLS2Nzc4' +
'eHm5uzs8fX1+vr9/f8AAAA5TEFNRTMuOThyAksAAAAAAAAAABQwJAbATgAAMAAAKfXcScCrA' +
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' +
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' +
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' +
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' +
'AAAAAAAAAAA//sQZAAP8GUAPpAAElANIBegACIAAVABEgAASVAvgGLAAAgGAJAP/////8QO3' +
'qdw//////+o4+H6hgQDEEP/////XqS6vRfFv/////1LzL0ixOTIKgg//////bgwKUXPEYSV/' +
'X6X1Z3/+xBkCYzQbwBDiAEQCAiF+KAAAm+B1AMSQABAIC+AYcQACAQQzNEAEgH/////uoUpF' +
'q4vHBMP/////66yz9qjbiff1NuoNr/////+lz17lmyaEh/////+W64DdiBCTQf/////77elo' +
'v/7EGQTDdAqL8WAABP+C6AIsAACTYGIAQ4gBEAgLoAiBAAIBK1Yna4ADMeMbvjjf13/6+VgA' +
'UP0AE/ROAAhEI/c68JBn60Z+++gD5KvM00yEH/////25QBbligxEKAsBBUOiW32dug0//sgZ' +
'CCAAUchQZUEYAINwAhRoAgAinDHK7k5AAAAACODACAAAAAAaagDXgyOzB9C/rcWSHP3YVIP3' +
'91EkgPhS9lqjAAVwVgT5bTas+owEjGOLwNx2V9a6KRPDIiDxzhZv+/yBCBw2QPocFKB8aoA0' +
'hVRMAHzREtJALdZjczqtKXAnf/7QGQKAGG3LMzPJGACDoAYWOAIAIeksTUkmGnINIAhLACJM' +
'BcsnAjTO8bauViEfm5E3+3UvF6KRTxedAELjQjYWlDgltG0AUAAActZ/////v7GOvNgfJUyh' +
'AGDqNCbRtNAENji08nSwGMMCSZ5OPqH3zX9bODrellO1MAlq42DOk4VISMa3Qj0NAXMugusU' +
'T3pgAQBHOf/////o7ZSwP0AIEgCLKIDYapAQCADZtOAsGUwvXEL//tAZAsA4ekoTeEmGeIO4' +
'BhjACIAB7S5NCeYaMgogGIMAIgARsIO3JqDzjj0+dzUI8qIwIftFMpqe45wEFhu0EJHLoRqf' +
'q1q92oFgAAwAf//////jlUC58IooBlQ1WMmQq9kHL2zHg5pYMoCsN0ckV8wNeIqECNAY/TRA' +
'+lUhYoLCLtztdxwimos3DgeHHu+UHMmxcbQQEmgD///////pXUlAHCAAPHrnlsGClBQV/ZRy' +
'411lYb/+0BkCghh2jBOsewZUgsgGHIAAgAHPHNDJJhPSDIAYewQCACl0+SEOEvqdps1J24R5' +
'asZniYqdk8rWq6GvVBJWFQRn2GHuLmEfEJABwP//////s5K0qBX8uByqE42BwrZGpRBM3KGD' +
'BJt8SFp5/7t7PMIM23BSsZrbT9PWQnIs5U7Y4JwTlGC7+V06cF6tCUoAAwv//////rtFG5hA' +
'QgYiCA1JS65BDqLEeEpAnAiaOcBw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MAh//' +
'////8LryKKidaHZgiv900t9WwSHr/TEI601/1TNTr0Nx9zwlMrmsc4WymkbgMkfE8/17SOZS' +
'qEh6Rpw2BS+aQgG7//////ZY9oLrWq4sQBVICmNLJyg6uMHNnKgSEy2gSiR//swZAsAYawn1' +
'cmKGzwJYBhxAAIAh3SpYYScbfgsgGKwAAgCupotvNENk+nHI/jHad6Ah2G/X5Sew9Ewxw+wt' +
'gJksYCj/////+tn+xUbLiCKqqQMTYYjKAnNnZIFkY4GNrDQB77SoPQTOnHoeMGMZdKNs8133' +
'gYBS3vEoJkcjC1yUerOeVE3nkEAAIBbv///////VdkNAGTcpGgA//tAZAQA4gEnVmktQ0oLo' +
'BiSAAIAh3DLZ6MpC7AxAGFIAAgCzEnYxSYoZJI7S4LAThpsx8cAy/xxCQPpn3g8IgjprDS/8' +
'8f0QpwDTprtliVmHazbiRGN2o5nzgMADAf/////+jrqUALGVCEUm21AAQwjPZiQaDKqMAP+Y' +
'hwW36SECBqWhkWdFXJCe03UXdk0wOpdJ0z1aQ00Nk65vr225b/as0gP//////csVbTULpWJh' +
'NgBGtP/+0BkAwBh6i1WaXErWg+ACFIAAlwHbKVVpkBrgCSAYaAAiAJwAVshiaYtMmLKqRIDu' +
'Mm20xLoyb91i9UnecIcPsihmc2UtdkdtEwFe2YYR9upRjsTo48fjMCjABYD/////6CrNNCnv' +
'Qk+MuICAAQMdbAEWnzEswCsiUi6gcBphY4azzWJUWUmhsgsWz9RBXV6Wn/5TnWSAz82BtyNH' +
'chZkmODIpoHkAAR///////6FdWAgAEAo//7QGQDAOH5MFXp8htaCeAYsgACAIgQu1lHxMuYJ' +
'wBiBAAAAmgBEbWS2a5aykxWFXFx8AqJUQN31iGoVqTqGTb8co09PBfp3IlkCqVFbMjioW0KR' +
'UKiM9ajqZhxrAAMB///////0Zn0IAQW26AItrX3A0uCtxPd6y8BPn1pJaAnY8nU1Y/m/2RHh' +
'vJg4mYduN8A2a/6yd1se96LPjPhqM1FZOKXgH6FrH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5cogKUMKjtNuoWFsYt7pZDlhH' +
'wEufPmprwOjuSqxjpen0M/+pEAPphz7Jx7pkTUgUPl7TcaSPNHgR//////0/uWlyAQABC668' +
'AVtYfVzEBTMn70HjAmLv09PY/DRVFczV+pRa7MsU532HUoWNe7TmH3ZYuBLUrz0Exk+mOFxH' +
'SektwExEmGepErnQADH//////3HiyDcSDAqZAGfgdt3/+z/+1BkBATiUy/TMZtB8g0ACFIAA' +
'gAJRKlLLQ2YiCSAYogACAQcA4Zl9fLGtMqJGSQCOURVzJ72uEpmmbYq372Wb0LRw36H+K/Cv' +
'SEIOdP85/j8bTlE0fQ4TzVGpAcgGn5+jDoLGSSAAwH//////90uGUvC7IBSUBY5O29ZYOkHK' +
'5bPY5cyYye2WRAYATGna9R9yWOmvLJqb3+3qSav/2zV78ay35EaGaPyUGrtymoj3+wEeUmsB' +
'ci7mJDTbj2yA//////+/3y1ZAeDgc/Vepjg//tQZASE8f0yUzNNVQAKYBhyACIACOzHRs2NV' +
'sgtAGFAAIgAo+W+vTvef8yehk3txhuHcb4OMFY2QVKGrZY4Kfcu6jhroqnnMqV6qn2LMZ0m+' +
's4C1ujX9HNLqADgf//////9s8lEUCA5dm8+8pnBDEiHozW1zXDnWdflMidMyqOqpEDw7F+7O' +
'zueNOnlnr3GKALHYa1k/Ai0PRvmvdyDd+GmMADhMNfXY7spCv//////697krCQfSlWAgABXq' +
'gNFai3sZSgQVzdusBVGcmewlP/7QGQMBMILMlfiSGzcCyZIMQAi4AkIwUrB6QXIOwBgyAAIA' +
'oYDzEcAeET3H+PfgbZccUsGqOK7hksYw/0pJ5akhLcNsovRah2QoomyIUf19O9Xr0YTowhCK' +
'2kDQNst6GhJvJqbGvhK09CNmLHG6MIp+dpRhqHXJ2q8GHKEEQKe4hrquoH/utjf/jq1vGE3e' +
'lsS3eW54CoDhRtbtZehxMacACA//////1UZ0mWDhNCaGDAASgmg//tQZAME4ewx09EaOdIK5' +
'jhCACLiyJC5SyXpB0g4AGGMAIg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iBaGLyPcZ1XS0OXX8qPfP453FGO81yhU8' +
'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' +
'kz338u/w2i05j6ubRYqXyk7xjKQEf//////qXMAQGC6gANRwcICnqCnjP/7UGQFD+JCMU6I2' +
'TF2CoAYwgAiAIjsxzoMINIIM4AhyAAJchrsznYzgABesUu8rS6uvIoh3/59swAe6kYJNGmlX' +
'9MHMunZgWpeTbPU2LL2i8l4yzyHmcqU04Tx8Ds2vSWiwAoD//////8U3aoru7latP6cTrdjE' +
'GTeODRgeOR3NaszDGSNnNLegKwC3crWC9OdRKALtjfHBie48MgGyrh2uPhp7kCZ9e9LPw7J/' +
'SoplY5ZSrAf/////+pRU2/aPBlwAAYESYABgoDRDmz4MXH/+1BkB4DiRy/Q0NhBYgbmGHAAA' +
'n9JNMM8xOUFiDMAIsgACXR/m7H8etDK/hresJ0ibhyLjEEFwocMRWdYWGUi2Z4Rz1S+3z6hq' +
'mIee6osMh7RpY2ySrd4eJQx1ACB10VFeVnHxAggBAOUChtGdiApBTYzmchrxUrWgW/nPZS4v' +
'eUI5ZuPuwKguDIsvuVkfuTCHTdijMagwlRGH3d0jlH6KPJpQ+qM/9htu8emaErUB///////E' +
'aQAWgQL1VCCAiDGiCQBF3SHmBkONxtG/qmC//tAZAoA4icyUuniNIgLYBhjAAIACQjJPMNlB' +
'YArAGHMAAgA70n3S0ENtU4+0GwHXXpYSSzbPbNeFNiKdfw+l7ueP3z+LZhrp5Npi02dbWk0v' +
'LviDAAAUAf//////696wIQAAAQaMRMFdJoHvq401WxFyK63Yz38TGIU46TGiCsDhXNJVLMGz' +
'KdJcyiq5EQqJqJxuOtVSkWSsMCtnveijyBWbem0guLMgwAf//////31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RcXLp6QwyHBIRBABZMmcjudpJmEEQHSOWomEI7Dp69E9sPID/////' +
'//6EQAAKAIgNDYvIUPU//tAZAWA8kUpURjPMPILJjhTAAJ+Rwy1T4SYY6gwAGFAAAgAI8gS5' +
'aXvCRrWPSXYXItxxKZmd2zkQlLZPxnyxuDHPKzMStmKKRNwpIGSJJSWj5jfgKhTLnDktlhWx' +
'H3hOEAAA0AeeuWsxCoHWlALKSSqwAYaAkmmdIEoJsP1sYtFGewLoImjlmrLx7F+iUYFd/mfu' +
'cU93rqTj5eRjYq60iBjpL1t//////+xgyskweGkqgAACRH/+1BkAgjB/jHPyYga8g8gGFIAA' +
'gAIEK0yxjzCiDkAYUgACAAgFrIQfEHZaNlag+cIuxNIYYYVcmlZ7pVp5yre1yc+46ilKGM70' +
'YSm6lLkBAwVo9lZoDedIvaFJgpBbEwBYD/////9lQWY6XUUD9BESADDp8JUbKN0lqSNEa5FF' +
'iWt3NlyJFteZkjnf06OdyMyckaRyjiVPOHJVrV65oSy5IvPqnk4l+ajgK4KhPGgwBIB/////' +
'9bd8Xa21yS9FgANmCgKwCNv/UBXUBXqFeJ///sQZAkN8SYjxZBhLEAOAAghACIAgYQC/AAEQ' +
'AAAACHAAAAEMK4Vv0UOgUvWY2IlZh2GumWPLQD//+X///fFGMcONPWv/////V/qBo8sNFQ0T' +
'EFNRTMuOTguMqqqqqqqqqqqqqqqqqr/+xBkC4/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAAN' +
'IAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq' +
'qqqqqqqqqqqqqqqqqqqqqqqqg==';
var a = $('<audio>');
a.attr('src', s);
try {
a[0].play();
} catch(e){console.log(e)}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<img src="https://i.stack.imgur.com/DkIzu.jpg" width="400"/>

Print ".00" When The Result Is A Whole Number?

I want to try and print ".00" after the variables cache.todayHigh and cache.todayLow are whole numbers.
if (ddimgtooltip.showTips) {
// update tooltip
tip = 'High ' + strings.baro_info + ': ' + cache.todayHigh + ' ' + data.pressunit + ' ' + strings.at + ' ' + data.TpressTH +
' <br> ' + strings.minimum_info + ' ' + strings.baro_info + ': ' + cache.todayLow + ' ' + data.pressunit + ' ' + strings.at + ' ' + data.TpressTL;
if (cache.trendVal !== -9999) {
tip += '<br>' + strings.baro_trend_info + ': ' + baroTrend(cache.trendVal, data.pressunit, true) + ' ' +
(cache.trendValRnd > 0 ? '' : '') + cache.trendValRnd + ' ' + data.pressunit + '/hr';
}
$('#imgtip5_txt').html(tip);
}
e.g. 1017 hPa to 1017.00 hPa.
Is this possible?
Thanks,
William
Try this,
var yvalue = '1702 hpa';
var num = yvalue.replace(/[^0-9]+/ig,"");
value = Number(num).toFixed(2);
var fvalue= value +' '+yvalue.split(' ')[1]
console.log(fvalue);

Make hover text smaller using Tipsy in D3

Tipsy is used to display a lot of text when hovering over my nodes and I'd like to make that text smaller. How do I do that?
$('.node').tipsy({
gravity: 'w',
html: true,
title: function() {
var d = this.__data__, id = d.id, inc_calls = d.inc_calls, out_calls = d.out_calls, inc_texts = d.inc_texts, out_texts = d.out_texts;
return 'Incoming Calls: ' + inc_calls + '<br/>' + 'Outgoing Calls: ' + out_calls + '<br/>' + 'Incoming Texts: ' + inc_texts + '<br/>' + 'Outgoing Texts: ' + out_texts ;
}
});
wrap the text that you are returning for title with a span which has style with font-size that you wish.. for example i have set the font size to 10 px you can reset it to a size which fits for your situation.
<span style="font-size:10px">+ your_title_text +</span>
$('.node').tipsy({
gravity: 'w',
html: true,
title: function() {
var d = this.__data__, id = d.id, inc_calls = d.inc_calls, out_calls = d.out_calls, inc_texts = d.inc_texts, out_texts = d.out_texts;
return '<span style="font-size:10px">Incoming Calls: ' + inc_calls + '<br/>' + 'Outgoing Calls: ' + out_calls + '<br/>' + 'Incoming Texts: ' + inc_texts + '<br/>' + 'Outgoing Texts: ' + out_texts + '</span>' ;
}
});

If statement does't change background image

The if statement gives me the correct information for swipeDirection and swipeLength and I've obtained both the results of the IF and the ELSE except for the image changing.
if ( (swipeDirection = 'down') && (swipeLength >= 180) ) {
touchEnabledElement.style.backgroundimage = 'railroadtracks.png';
document.getElementById('message').innerHTML = "IF" + 'Start H:' + startX + ' V:' + startY + '<br>' + ' End H:' + curX + ' V:' + curY + '<br>' + "Swipe Length: " + swipeLength + '<br>' + 'Swipe Angle: ' + swipeAngle + '°' + '<br>' + 'Swipe Direction: ' + swipeDirection + '<br><br><span style="font-size:.5em;">(Please wait for green screen before swiping again)<\/span>';
} else {
document.getElementById('message').innerHTML = "ELSE" + 'Start H:' + startX + ' V:' + startY + '<br>' + ' End H:' + curX + ' V:' + curY + '<br>' + "Swipe Length: " + swipeLength + '<br>' + 'Swipe Angle: ' + swipeAngle + '°' + '<br>' + 'Swipe Direction: ' + swipeDirection + '<br><br><span style="font-size:.5em;">(Please wait for green screen before swiping again)<\/span>';
touchEnabledElement.style.backgroundimage = 'railroadtracks2.png';
Try .backgroundImage (NB: capital "i")
The property is backgroundImage not backgroundimage, and the syntax of a URL in CSS is url(railroadtracks.png) not just railroadtracks.png
You're assigning (=) instead of comparing (==) here:
if ( (swipeDirection = 'down') && (swipeLength >= 180) ) {
Did you mean to do swipeDirection = 'down' instead of swipeDirection == 'down'?

JS regex isn't matching, even thought it works with a regex tester

I'm writing a piece of client-side javascript code that takes a function and finds the derivative of it, however, the regex that's supposed to match with the power rule fails to work in the context of the javascript program, even though it sucessfully matches when it's used with an independent regex tester.
The code is extremely bare-bones at the moment, and I'm planning to flesh it out later.
The browser I'm executing this on is Midori, and the operating system is Ubuntu 10.04 (Lucid Lynx). Here's the HTML page being used as the interface in addition to the code:
Page:
<html>
<head>
<title>
Derivative Calculator
</title>
<script type="text/javascript" src="derivative.js">
</script>
<body>
<form action="" name=form>
<input type=text name=f /> with respects to
<input type=text name=vr size=7 />
<input type=button value="Derive!" onClick="main(this.form)" /> <br />
<input type=text name=result value="" />
</form>
</body>
</html>
derivative.js:
function main(form) {
form.result.value = derive(form.f.value, form.vr.value);
}
function derive(f, v) {
var atom = [];
atom["sin(" + v + ")"] = "cos(" + v + ")";
atom["cos(" + v + ")"] = "-sin(" + v + ")";
atom["tan(" + v + ")"] = "sec^(2)(" + v + ")";
atom["sec(" + v + ")"] = "sec(" + v + ")*tan(" + v + ")";
atom["1/(cos(" + v + "))"] = "sec(" + v + ")*tan(" + v + ")";
atom["csc(" + v + ")"] = "-csc(" + v + ")*cot(" + v + ")";
atom["1/(sin(" + v + "))"] = "-csc(" + v + ")*cot(" + v + ")";
atom["cot(" + v + ")"] = "-csc^(2)(" + v + ")";
atom["1/(tan(" + v + "))"] = "-csc^(2)(" + v + ")";
atom["sin^(-1)(" + v + ")"] = "1/sqrt(1 - " + v + "^(2))";
atom["arcsin(" + v + ")"] = "1/sqrt(1 - " + v + "^(2))";
atom["cos^(-1)(" + v + ")"] = "-1/sqrt(1 - " + v + "^(2))";
atom["arccos(" + v + ")"] = "-1/sqrt(1 - " + v + "^(2))";
atom["tan^(-1)(" + v + ")"] = "1/(1 + " + v + "^(2))";
atom["arctan(" + v + ")"] = "1/(1 + " + v + "^(2))";
atom["sec^(-1)(" + v + ")"] = "1/(|" + v + "|*sqrt(" + v + "^(2) - 1))";
atom["arcsec(" + v + ")"] = "1/(|" + v + "|*sqrt(" + v + "^(2) - 1))";
atom["csc^(-1)(" + v + ")"] = "-1/(|" + v + "|*sqrt(" + v + "^(2) - 1))";
atom["arccsc(" + v + ")"] = "-1/(|" + v + "|*sqrt(" + v + "^(2) - 1))";
atom["cot^(-1)(" + v + ")"] = "-1/(1 + " + v + "^(2))";
atom["arccot(" + v + ")"] = "-1/(1 + " + v + "^(2))";
atom["ln(" + v + ")"] = "1/(" + v + ")";
atom["e^(" + v + ")"] = "e^(" + v + ")";
atom["ln(|" + v + "|)"] = "1/(" + v + ")";
atom[v] = "1";
var match = "";
if (new Boolean(atom[f]) == true) {
return atom[f];
} else if (f.match(/^[0-9]+$/)) {
return "";
} else if (f.match(/([\S]+)([\s]+)\+([\s]+)([\S]+)/)) {
match = /([\S]+)([\s]+)\+([\s]+)([\S]+)/.exec(f);
return derive(match[1], v) + " + " + derive(match[4], v);
} else if (f.match(new RegExp("^([0-9]+)(" + v + ")$"))) {
match = new RegExp("^([0-9]+)(" + v + ")$").exec(f);
return match[1];
} else if (f.match(new RegExp("^([0-9]+)(" + v + ")\^([0-9]+)$"))) {
match = new RegExp("^([0-9]+)(" + v + ")\^([0-9]+)$").exec(f);
return String((match[1] * (match[3]))) + v + "^" +
String(match[3] - 1);
} else {
return "?";
}
}
In particular, I'm having trouble with this pattern:
} else if (f.match(new RegExp("^([0-9]+)(" + v + ")\^([0-9]+)$"))) {
match = new RegExp("^([0-9]+)(" + v + ")\^([0-9]+)$").exec(f);
return String((match[1] * (match[3]))) + v + "^" +
String(match[3] - 1);
You need to double-escape your caret:
")\\^([0-9]+)$"
Otherwise javascript doesn't interpret the backslash as a backslash, and therefore never escapes the caret for the regex.

Categories