473,405 Members | 2,167 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,405 software developers and data experts.

Javascript and SSL connections.

Hey Guys,

Before I start I have searched the forums for similar threads and there are a few that sort of cover what I'm asking about, but I havent been able to fix my problem based on those threads and I'd rather not dig up dead topics.

So heres my problem. I'm not really a web developer but I do know other programming languages. What I'm trying to make is a Firefox toolbar that can send a request to an HTTPS website and then scan it for new information. So far my code looks like this...

Expand|Select|Wrap|Line Numbers
  1. function STB_Update() 
  2. {
  3.         alert("st1");
  4.         var label = document.getElementById("STB-webct");
  5.  
  6.         var xmlhttp = false;
  7.  
  8.         try {
  9.             xmlhttp = new XMLHttpRequest();
  10.         } catch(e) { xmlhttp = false; alert("oops");}
  11.  
  12.         if(xmlhttp) {
  13.             alert("st2");
  14.             xmlhttp.open("GET", "https://*domain*/webct/populateMyWebCT.dowebct", true);
  15.             xmlhttp.onreadystatechange = function() 
  16.             {    
  17.                 alert("st3");
  18.                 if(xmlhttp.readyState == 4)
  19.                 {
  20.  
  21.                     var content = xmlhttp.responseText;
  22.                     if(!content.match(/You currently have no new grades./i)) {
  23.                         label.setAttribute("label", "*There are new grades!*");
  24.                     }
  25.                     else if(!content.match(/You currently have no entries for today./)) {
  26.                         label.setAttribute("label", "*There are new calender entries!*");
  27.                     }
  28.                     else { label.setAttribute("label", "No new WebCT Information"); }
  29.  
  30.                 }
  31.             xmlhttp.send(null);
  32.             }
  33.  
  34.     }
  35. }

Most of this code isnt mine, I've just modified it to serve my own purpose (Why reinvent the wheel?) As you can see I've added alerts in to try and debug my code, It sends me alert st1 and st2 but I never get st3 or an oops.

But I've made a few assumptions that XMLHttpRequests can do HTTPS requests aswell. And also that if Firefox is set to remember my password for this website then the request will have permission aswell.

So my questions are, can I send HTTPS requests?
Will the request sent need to authenticate with my username and password if firefox is already set to remember me (so normally when I use that URL I never even see the authentication screen.)
Also, is there anything wrong with my code?

Sorry if my questions are a bit newbish. Also, I don't know if anyone here has created a firefox toolbar before, but is there a good way of testing the javascript without remaking the xpi file every time? Its a major pain in the butt, especially if you don't get to see any progress after doing it like 20 times :S.
Jan 18 '08 #1
1 1555
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

I don't think it's possible to make HTTPS requests unless already on the secure domain.
Jan 21 '08 #2

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

Similar topics

3
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50...
2
by: Uwe Mayer | last post by:
Hi, I want do use liburl to scan a webpage which is only accessible from within my LAN environment. While mozilla manages to load the target URL properly neither wget, nor liburl or liburl2...
3
by: mydirac | last post by:
hello, I'm thinking about javascript's producing another file. Can I do it?
4
by: john | last post by:
I have 2 major issues currently with javascript. 1. Doesnt anybody do any server side javascript anymore. I cant find anything on the net about it. My major issue is with database connections...
4
by: Tim Tyler | last post by:
Has anyone ever built a JavaScript Telnet client? What about a JavaScript SSH client? -- __________ |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.
3
by: Andy | last post by:
Hi, I am complete JavaScript novice and would really appreciate some help with this code: ===================================================================== <%@LANGUAGE="VBSCRIPT"...
4
by: milkyway | last post by:
Hello everyone, I have a few values and variables that I want to post to a server (without using a SUBMIT button). Is there a way to post data from within javascript - do sockets or connections...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.