• We just upgraded the platform on which this website runs! Please inform @Jaxel of any issues.

Double Piping not working?

Superrobotking

New member
Not sure if I am doing this right or if I missed anything but doing || doesnt seem to do anything except now show up.

Ran a basic LF || Losers Final and it would come out as LF Losers Final

if theres a video or anything that would be helpful.
 

Jaxel

Administrator
The double piping has to be in your code. It's not a default thing.

So for instance, you would do something like:
Code:
var versus_1 = docData['versus_1'].split('||');
Then you would access the two pieces of data with versus_1[0] and versus_1[1].
 

Superrobotking

New member
Ah great! Took a while and my brain is semi fried but I figured out the array setup.
HTML:
<div id="FC1"></div>
<div id="AC1"></div>.
Code:
var chips1 = docData['chips_1'].split('||');
document.getElementById("FC1").innerHTML = chips1[1];
document.getElementById("AC1").innerHTML = chips1[0];
 

Jaxel

Administrator
You can use jQuery instead of basic JavaScript BTW....

Code:
$("#FC1").html(chips1[1]);
$("#AC1").html(chips1[0]);