-
October 27th, 2008, 01:13 PM #1Junior Member
- Join Date
- Oct 2008
- Posts
- 2
Beginner in Javascript, need help with Firefox add-on
I haven't worked in Javascript before, but an opportunity to dive in
arose when my boss asked me to update our custom add-on that runs a
search on different sites (eBay, Google, Google Shopping, etc.)
simultaneously. What happened was eBay changed their research company,
and now we have to manually log in to get certain features. Problem is
the new company is a single user only site, so when another computer
logs in (we have 12) it kicks the person that was logged in
previously. We aren't getting separate logins for everybody because
they charge for that.
Anyway, back to the problem. I need our search bar to go to the login
site so that our aout-login tool can login, and then have the search
tool's script load the search URL with the search term embedded in it.
Here's what it look's like so far (part of it anyway, there is a lot more, but this is where the trouble area is):
// doSearch - Called when the Search Button is clicked
//
function doSearch()
{
// Handle terapeak a bit differently... create the search URL with the search term embedded
var szURL = "Login - Terapeak eBay Marketplace Research"
var sqURL = "Login - Terapeak eBay Marketplace Research";
sqURL+=escape(document.getElementById("searchTerm" ).value);
sqURL+= "&siteID=0&id=0&date_range=90&date=&view=report&se arch=1&"
loadURI(szURL);
}
function processKeyUp(event)
{
// If the Enter key (keyCode: 13) was pressed, perform a search
if (event.keyCode == 13)
doSearch();
So after it does the "loadURI(szURL), and I need it pause to let the
autologin tool do it's thing, after which it brings us to the search
page in terapeak, and then load the (sqURL).
Hopefully it's something simple that someone out there can show me. I
am a beginner in programming/scripting, but I am interested in it, so
I have tried to do some research and reading on this, but I haven't
been able to find anything that works.
Thanks in advance. I can send anyone the .xpi if they want to look
into it.
-
October 28th, 2008, 10:49 PM #2Junior Member
- Join Date
- Sep 2008
- Posts
- 18
First off you have an unterminated string constant (details below).
Also, I've never heard of a loadURI, but if that's what is working for you, go for it.
As for what you're asking the page to do, give you a loading bar or something I'm guessing, I'm clueless. I don't know why you'd want something like that, but I guess you're getting paid to give the guy answers right?
Well... do what I normally do. Take apart a 'redirect page' by loading one of them, stopping it before it changes the page and taking the source apart. Either way, I hope you find the answers you seek. If you dont, PM me about it, I'll give you my email so you can send me the whole thing to take a look at. Sounds like fun :-)
Code:... // There should be a ; after me :-) sqURL+= "&siteID=0&id=0&date_range=90&date=&view=report&se arch=1&" ...
-
October 29th, 2008, 06:54 PM #3Junior Member
- Join Date
- Oct 2008
- Posts
- 2
Thanks for getting back to me, ah.
I actually caught the unterminated string after I posted yesterday by going through the whole page, but good eye.
What I want to do is go to a login page, automatically login there either by using a separate autologin tool or having the add-on do it (which I don't know how to do either), and then after logging in, load a search-term-embedded URL.
We have a search tool that searches multiple site: Terapeak, Google, and eBay. Terapeak is a sales research site for past eBay auctions (we are an eBay power seller, in case you haven't figured that out yet). The way Terapeak is set up is you have to login in order to run searches past a 14 day history, so to run searches with a history of 90 days. Terapeak is also a single-user site, so once another computer logs in, it kicks whoever was previously logged in out (we have about 12 employees). That's why I need our tool to go to the login site before every search, then load the search URL after the search page (which comes after the login page) loads. And that's where I'm stuck.
I'm also not the original author, and this my first foray into Javascript...or any other language for that matter, so I'm just kind "wingin' it" as I go. What I've been finding has been for web pages, and not so much for a Firefox add-on, and so hasn't been working as well.
Also, as far as I know, loadURI is specific to Firefox, but I could be wrong.
I would be glad to send you the .xpi file so you can see what we have and how it works, or just the .js file if that's all you need.
If you could help me out with this, I would be sooooo appreciative of it. Hopefully this is a bit more clear of what I need our add-on to do.
Thanks again!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Beginner in Javascript I need help!!
By overdosed20 in forum Webmastering and ProgrammingReplies: 6Last Post: June 24th, 2008, 11:34 AM -
Beginner Javascript question
By James Engle in forum Webmastering and ProgrammingReplies: 0Last Post: April 21st, 2008, 10:43 PM -
Beginner, javascript code help!
By snikker74 in forum Webmastering and ProgrammingReplies: 4Last Post: April 4th, 2008, 11:08 AM -
Javascript HTML for Firefox
By daedreem in forum Webmastering and ProgrammingReplies: 3Last Post: August 25th, 2006, 06:52 PM



LinkBack URL
About LinkBacks



Reply With Quote

lulz. ^_^ Today is 5/22. Two year anniversary of the Joplin tornado. :( In better news, Daft Punk's album is out and my LP is in the mail. :cool:
Is It Just Me? v233893843