characters and strings in JavaScript, the program attempts to map these strings into valid JavaScript commands (e.g. window.alert). Remembering that anything in is a non-changing value and that anything in the “” format window.location. is either a method (i.e. it performs some task) or a value (i.e. it stores some information) take the above URL and write apply the code in line 4 against it. Write down the new URL that would be generated if we were to call the window.location.replace method on it. New URL: Now, lets copy our new URL and paste it in a web-browser. Were you prompted to login to researchport? Did you pull up a webpage from which you could get the full text? Lets try it again by taking the code on lines 3-5 and assembling them into a single line of code. Load the ACM Url again and then copy and paste your singl line of code from step 10 into the URL. Hit enter. What happens? Did you get through the proxy? A quick note on query strings. Query strings are all of the text in a URL that come after the Query strings “?”. are used to pass variables to web applications so that they know what to do next. In the above URL, the query string is id=1734388. Create our bookmarklet We can see that applying this JavaScript operation to the above url redirects it through the university proxy server. This means that we can be off campus when we find a resource on the web and use this code to access the resource using the campus proxy server. Now that we have explored the components of our JavaScript function and understand what it does lets turn it into a bookmarklet so that we can have simple access to this function anytime we need it.
characters and strings in JavaScript, the program attempts to map these strings into valid JavaScript commands (e.g. window.alert). Remembering that anything in “” is a non-changing value and that anything in the format window.location. is either a method (i.e. it performs some task) or a value (i.e. it stores some information) take the above URL and write apply the code in line 4 against it. Write down the new URL that would be generated if we were to call the window.location.replace method on it. New URL: Now, lets copy our new URL and paste it in a web-browser. Were you prompted to login to researchport? Did you pull up a webpage from which you could get the full text? Lets try it again by taking the code on lines 3-5 and assembling them into a single line of code. Load the ACM Url again and then copy and paste your singl line of code from step 10 into the URL. Hit enter. What happens? Did you get through the proxy? A quick note on query strings. Query strings are all of the text in a URL that come after the “?”. Query strings are used to pass variables to web applications so that they know what to do next. In the above URL, the query string is id=1734388. Create our bookmarklet We can see that applying this JavaScript operation to the above url redirects it through the university proxy server. This means that we can be off campus when we find a resource on the web and use this code to access the resource using the campus proxy server. Now that we have explored the components of our JavaScript function and understand what it does lets turn it into a bookmarklet so that we can have simple access to this function anytime we need it.
03_acq_javascript_worksheet1.docx