Ask your own question, for FREE!
LaTeX Practicing! :) 21 Online
whitemonsterbunny17 (whitemonsterbunny17):

Don't use it to prank someone, this is only for educational purposes.

OpenStudy (abhisar):

Let's start by first understanding what javascript basically is ? JavaScript (JS) is a dynamic computer programming language. It is most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed.

OpenStudy (abhisar):

Like every other programming language it has its own basic set of rules.

OpenStudy (abhisar):

Let's start from some basic techniques like the Warning pop up

OpenStudy (abhisar):

The command we use for it is called confirm. Ex confirm('Saira is LaTeX Queen') Will show \(\large\sf\color{blue}{\underline{\href{javascript:confirm('Saira is LaTeX Queen')}{This}}}\)

whitemonsterbunny17 (whitemonsterbunny17):

\(\normalsize\cal\color{magenta}{Okay~ (:}\)

OpenStudy (abhisar):

Now the basic question is how to run such commands on OS ?

OpenStudy (abhisar):

For that u just need to integrate a js with LaTeX

OpenStudy (abhisar):

U can do this by creating a Hyperlink

OpenStudy (abhisar):

gaetting it ?

OpenStudy (abhisar):

*getting

whitemonsterbunny17 (whitemonsterbunny17):

Sort of, yeah.

OpenStudy (abhisar):

only sort of ?

whitemonsterbunny17 (whitemonsterbunny17):

I understand so far, but I don't know how to make a hyperlink haha

OpenStudy (abhisar):

``` \(\large\sf\color{blue}{\underline{\href{Put Js code here}{Stuff}}}\) ```

whitemonsterbunny17 (whitemonsterbunny17):

Okay

OpenStudy (abhisar):

Now can u create a pop up ?

whitemonsterbunny17 (whitemonsterbunny17):

I am not sure what to insert for the Js code

OpenStudy (abhisar):

Code for the last example ``` \large\sf\color{blue}{\underline{\href{javascript:confirm('Saira is LaTeX Queen')}{This}}} ```

OpenStudy (abhisar):

Green part is Js code, rest is LaTeX

whitemonsterbunny17 (whitemonsterbunny17):

Okay, makes sense so far. (:

OpenStudy (abhisar):

Create a new one now

whitemonsterbunny17 (whitemonsterbunny17):

\(\large\sf\color{blue}{\underline{\href{javascript:confirm('This is AWESOME')}{This}}}\)

whitemonsterbunny17 (whitemonsterbunny17):

Did it work? (:

OpenStudy (abhisar):

Yes it' awesome !

whitemonsterbunny17 (whitemonsterbunny17):

\(\Large\cal\color{magenta}{YAY!!!!!}\)

OpenStudy (abhisar):

Lesson 2 !

whitemonsterbunny17 (whitemonsterbunny17):

:D

OpenStudy (abhisar):

Creating a Prompt (However it does not looks so cool on OS)

OpenStudy (abhisar):

Why @Elsa213 is silent ?

Elsa213 (elsa213):

im no silent ;D

OpenStudy (abhisar):

okay the trick is simple and similar to last command. prompt('Do you like Javascript ?') It will show \(\large\sf\color{blue}{\underline{\href{javascript:prompt('Do you like Javascript ?')}{This}}}\)

whitemonsterbunny17 (whitemonsterbunny17):

Okay. (:

Elsa213 (elsa213):

\(\large\sf\color{blue}{\underline{\href{javascript:confirm('Saira is LaTeX Queen')}{This}}}\)

OpenStudy (abhisar):

Make one !

Elsa213 (elsa213):

\(\large\sf\color{blue}{\underline{\href{Put Js code here}{Stuff}}}\)

whitemonsterbunny17 (whitemonsterbunny17):

\(\large\sf\color{blue}{\underline{\href{javascript:prompt('Do you like Javascript?')}{This}}}\)

OpenStudy (abhisar):

@Elsa213 urs is not working @Whitemonsterbunny17 u just copied mine !

whitemonsterbunny17 (whitemonsterbunny17):

Haha I did copy you @Abhisar, but I typed it out haha

OpenStudy (abhisar):

``` \(\large\sf\color{blue}{\underline{\href{@elsa u have to put a code here}{Stuff}}}\) ```

Elsa213 (elsa213):

:o it not working?

OpenStudy (abhisar):

Ok guys try this website http://psycode.co/index.html If u guys really wanna learn javascript better.

Elsa213 (elsa213):

\(\large\sf\color{blue}{\underline{\href{javascript:confirm('Saira is LaTeX Queen'}{Stuff}}}\) did it work now?

OpenStudy (abhisar):

Nopes !

whitemonsterbunny17 (whitemonsterbunny17):

\(\large\sf\color{magenta}{\underline{\href{javascript:confirm('Abhisar is AWESOME!')}{Click~Here!}}}\)

OpenStudy (abhisar):

\(\large\sf\color{magenta}{\underline{\href{javascript:confirm('Not more than you')}{Click~Here!}}}\)

Elsa213 (elsa213):

:o i thought i got suspended

OpenStudy (abhisar):

Why ?

whitemonsterbunny17 (whitemonsterbunny17):

\(\large\sf\color{purple}{\underline{\href{javascript:confirm('Yes, way more!')}{Click~Here!}}}\) @Abhisar

whitemonsterbunny17 (whitemonsterbunny17):

And yeah, whyyy? @Elsa213 :o

Elsa213 (elsa213):

I clicked it

Elsa213 (elsa213):

O_O

OpenStudy (abhisar):

@Whitemonsterbunny17 \(\large\sf\color{green}{\underline{\href{javascript:confirm('We both are equally awesome Saira :)')}{Click ~Here}}}\)

Elsa213 (elsa213):

javascript:confirm('Your OpenStudy user has been issued a warning: Please refer to our code of conduct at openstudy.com/code-of-conduct for more information. Thank you.If you feel this was in error or have any questions, please contact abuse@openstudy.com.')

OpenStudy (abhisar):

XD

Elsa213 (elsa213):

:o

whitemonsterbunny17 (whitemonsterbunny17):

Hahaha

OpenStudy (abhisar):

u know one guy received a real warning for doing that !

Elsa213 (elsa213):

O_O

whitemonsterbunny17 (whitemonsterbunny17):

Really? :o

whitemonsterbunny17 (whitemonsterbunny17):

Hahahahaha

Elsa213 (elsa213):

lol

OpenStudy (abhisar):

I showed him the trick and he copied it and was showing it off everywhere to newbies. They got panicked and reported him

OpenStudy (abhisar):

U know i pranked thom yesterday with this one !

Elsa213 (elsa213):

im having problems doing that

Elsa213 (elsa213):

the little box

whitemonsterbunny17 (whitemonsterbunny17):

You did?? :o @Abhisar What was his reaction??

Elsa213 (elsa213):

interesting :o

OpenStudy (abhisar):

yes ! He was laughing ! XD

Elsa213 (elsa213):

ooo I never seen thomaster laugh before

OpenStudy (abhisar):

ahahaha

whitemonsterbunny17 (whitemonsterbunny17):

Hahahaha that's awesome!! XD

Elsa213 (elsa213):

can u help me with the box?

OpenStudy (abhisar):

He said that it can be misleading !

whitemonsterbunny17 (whitemonsterbunny17):

Yes, I would remove the last sentence because users may actually email due to being concerned haha

OpenStudy (abhisar):

http://prntscr.com/41hkf4

OpenStudy (abhisar):

yes, this is why i remove the post after pranking

whitemonsterbunny17 (whitemonsterbunny17):

Haha but mods can still see deleted posts :p

OpenStudy (abhisar):

Yeah, but if i delete my post how will u report me ? :P

whitemonsterbunny17 (whitemonsterbunny17):

True, unless you made other replies on the post ;p

OpenStudy (abhisar):

XD XD XD

Elsa213 (elsa213):

@Abhisar can u help me do the box?

OpenStudy (abhisar):

@Elsa213 \(\rm \href{javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}function E(e){var t=m(e);return t>=w&&t<=b+w}function S(){var e=document.createElement("audio");e.setAttribute("class",l);e.src=i;e.loop=false;e.addEventListener("canplay",function(){setTimeout(function(){x(k)},500);setTimeout(function(){N();p();for(var e=0;e<O.length;e++){T(O[e])}},15500)},true);e.addEventListener("ended",function(){N();h()},true);e.innerHTML=" <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";document.body.appendChild(e);e.play()}function x(e){e.className+=" "+s+" "+o}function T(e){e.className+=" "+s+" "+u[Math.floor(Math.random()*u.length)]}function N(){var e=document.getElementsByClassName(s);var t=new RegExp("\\b"+s+"\\b");for(var n=0;n<e.length;){e[n].className=e[n].className.replace(t,"")}}var e=30;var t=30;var n=350;var r=350;var i="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";var s="mw-harlem_shake_me";var o="im_first";var u=["im_drunk","im_baked","im_trippin","im_blown"];var a="mw-strobe_light";var f="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";var l="mw_added_css";var b=g();var w=y();var C=document.getElementsByTagName("*");var k=null;for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){if(E(A)){k=A;break}}}if(A===null){console.warn("Could not find a node of the right size. Please try a different page.");return}c();S();var O=[];for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){O.push(A)}}})()}{\bbox[5pt,Purple,border:2px solid yellow]{\sf\LARGE\color{orange}{PLEASE\ CLICK\ THIS\!!!!!!}}}\)

OpenStudy (abhisar):

yes sure i'll help uh

Elsa213 (elsa213):

i am not pressing nothing

OpenStudy (abhisar):

Pls press it...u'll enjoy

whitemonsterbunny17 (whitemonsterbunny17):

\(\large\sf\color{red}{\underline{\href{javascript:confirm('You have been issued a warning by the user: Whitemonsterbunny17. Please refer to our code of conduct at openstudy.com/code-of-conduct for more information.')}{Click~Here!}}}\)

whitemonsterbunny17 (whitemonsterbunny17):

Haha it's fun, click it @Elsa213

OpenStudy (abhisar):

\(\color{blue}{\text{Originally Posted by}}\) @Whitemonsterbunny17 \(\large\sf\color{red}{\underline{\href{javascript:confirm('Ok Mam !')}{Click~Here!}}}\) \(\color{blue}{\text{End of Quote}}\)

Elsa213 (elsa213):

omg it scared me

OpenStudy (abhisar):

XD

Elsa213 (elsa213):

my volume is 2 loud

OpenStudy (abhisar):

ok now lets see how to make that box @Elsa213

whitemonsterbunny17 (whitemonsterbunny17):

Yes!! The evil box!! :D

Elsa213 (elsa213):

yesh du evil 1

OpenStudy (abhisar):

No i was talking about the warning box @Elsa213 :P

Elsa213 (elsa213):

pwease :(

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!