473,412 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Google App Javascript Import of html

391 Expert 256MB
Hi.

Firstly apologies, but I'm experimenting and hope my question makes some kind of sense!

I am trying to write a script for a google spreadsheet, and would like to import some crypto code from elsewhere.

The code I would like to use is here. The home page, showing the usage is here.

I have written some code to test the principle:
Expand|Select|Wrap|Line Numbers
  1. function endecode(){
  2.  
  3.   var sheet=SpreadsheetApp.getActiveSheet();
  4.   var input=sheet.getRange(2, 1);
  5.   var password=sheet.getRange(2,2);
  6.   var encrypted=sheet.getRange(2,3);
  7.   var decrypted=sheet.getRange(2,4);
  8.  
  9.  
  10. encrypted.setValue(CryptoJS.TripleDES.encrypt(input.getValue(), password.getValue()));
  11. decrypted.setValue(CryptoJS.TripleDES.decrypt(encrypted.getValue(), password.getValue()));
  12.  
  13. };
  14.  

Obviously this doesn't work, because it doesn't recognize cryptoJS. But how can I import CryptoJS.

I know almost nothing about JavaScript - my method is just to copy and edit snippets from elsewhere, which works fine since I'm generally doing very simple things!

I even tried just copying the stuff from http://crypto-js.googlecode.com/svn/...s/tripledes.js straight into my function, but when I run it, there is a server error.
Oct 29 '12 #1
1 1954
Rabbit
12,516 Expert Mod 8TB
What's the server error? You shouldn't copy it into your function. It has functions of its own and those need to be declared outside any other function.
Oct 29 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: quikquic | last post by:
Suppose I download a html file with javascript in it, for example, <html> <body> <script language="JavaScript"> document.write("Hello"); </script> </body> </html>
6
by: Gaurav | last post by:
Hello, i have some java script with in html. It runs fine on IE 6.0 but doesnt run on some browsers like IE 5.0. Can someone tell me whats the problem ? And how can i solve it. here is the...
1
by: oleg_orel | last post by:
I need to access web sites using my scripts written in Perl. I use lynx and elinks to access web pages. It works fine, unless the pages has some Javascript code. Most Javascript stuff is working...
1
by: onewebclick | last post by:
Is there a way to detect a browser cache is full using javascript or HTML thorugh a web page and inform the user to clear the cache to improve performance of the website. It looks like google's...
4
by: dude718 | last post by:
is there a way to import *.html file to message.body string element of mailmessage class without have to actually type it up. Also is the maximum limit to how much can a string hold. I have...
1
by: Joseph Scoccimaro | last post by:
I am using greasemonkey to create a script that allows one to analyze a web page. Currently I am trying to import the javascript from an external file to add to the DOM of a web page. It is...
13
by: UnaCoder | last post by:
Hi, I'm trying to use client side JavaScript from an HTML file to open and make changes to an Excel SpreadSheet using ADO w/ ODBC. What a pain it is to do this. Anyways, I am able to open the...
6
by: dark.peony | last post by:
Hi, (--1--) I'm trying to find a way to jump to a link (<a href="ref"></a>) in a page that is generated with javascript. The source view of the page only shows the javascript methods. The...
0
by: Anuack Luna | last post by:
Hello. My english not is good. Please help me in the translation and the answer to this question Come. I do not know if someone fix conversion link Example: I ejemplo.php ID = 1 which the...
1
by: ashwani40 | last post by:
I am having a site in which dynamically header part is changing as in each and every page there is a script called which checks the referring url and according to that url script invoke a header.html...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.