Computer Hope

Software => Computer programming => Topic started by: paulinnorway on October 25, 2006, 12:39:52 PM

Title: JavaScript: Get info from other web pages
Post by: paulinnorway on October 25, 2006, 12:39:52 PM
Hi,

I'm new to JavaScript and I'm still trying to understand it all. The reason I'm "trying" to learn JavaScript is to make my life easier.

My problem is as follows.....

I am starting to sell electrical products locally.
Go to http://www.cafecom.no/shop/ and click on one of the product icons to see how my site displays things.

As you can see, the webpage is split into 3 frames:
- Top frame is the heading
- Middle frame opens an outside site (the site I shop with: http://www.norek.no)
- Bottom frame is blank (I want this to diaplay the price of each item, depending on what the middle frame contains).

As you will notice, the middle frame contains no prices. This is because you need to be logged in as a business to see the prices. Obviously my customers can't be logged in or they would be able to order products without me getting a chance to add my profit to the price!

I'll give you an example of what I would like to do:
As the customer browses, I would like JavaScript to "read" the product number from the middle frame. That's all I need, to get the product number from each page.
Since the format of each page is the same, I was hoping that JavaScript could search for the word "varenummer" (ie. "product number"), and then retrieve the next 6 numbers (which would be the actual product number).

I'm not sure I've explained myself too well, but I hope you understand what I want.

Thanks, and hopefully someone can point me in the right direction....or at least tell me if what I'm asking is even possible with JavaScript!  ;D
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 25, 2006, 04:24:40 PM
u might be able to do it with javascript but dunno php or perl might be better lets wait for rob or some one k


unlovedwarrior
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 03:12:21 AM
Quote
u might be able to do it with javascript but dunno php or perl might be better lets wait for rob or some one k


unlovedwarrior
Thanks for the reply.
I hope I can do I with JavaScript because I don't want to have to learn another language ;)
I don't mind if using JavaScript is messier or less efficient......as long as it works.
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 26, 2006, 08:14:19 AM
maybe someone with more scripting knowledge will show up.. cuz im a virus section creature i just get lost sometimes and try to help in the forums i fall into..
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 08:18:23 AM
Quote
maybe someone with more scripting knowledge will show up.. cuz im a virus section creature i just get lost sometimes and try to help in the forums i fall into..
Thanks for keeping me company while I'm waiting for the experts to show up ;D
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 26, 2006, 08:22:53 AM
your welcome have you tried the google lord
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 08:35:18 AM
I've tried a few google searches but it's very difficult to think of a phrase that best describes my problem. It's been no help so far.
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 26, 2006, 08:36:43 AM
try frames and javascript
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 08:45:14 AM
Quote
try frames and javascript
I'll try that. Thanks.
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 26, 2006, 08:49:23 AM
just modify the search words
Title: Re: JavaScript: Get info from other web pages
Post by: soybean on October 26, 2006, 11:32:47 AM
Quote
As you will notice, the middle frame contains no prices. This is because you need to be logged in as a business to see the prices. Obviously my customers can't be logged in or they would be able to order products without me getting a chance to add my profit to the price!

This doesn't make sense.  How would you make a profit, by charging more than the price listed by Norek?  What happens if visitors to your site saw your listed price but then go ahead and login to Norek and see a lower price?  And even if you display a price for the item on your page, how will customers place an order?  They can not do that if you do not have shopping cart functionality built-in to your site.  

I think you need to re-think this whole idea.  If you want to sell products that really come from  another online seller, you should probably be seeking a formal affiliate relationship.  For example, if you applied to be an affiliate of Amazon.com and were approved, you would be issued a special code that becomes part of your URL.  Then, when you place links on your site that lead to Amazon.com and the customer makes a purchase, you get a small commission.  

Do a Google search on affiliate selling.
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 12:11:39 PM
Quote
Quote
As you will notice, the middle frame contains no prices. This is because you need to be logged in as a business to see the prices. Obviously my customers can't be logged in or they would be able to order products without me getting a chance to add my profit to the price!

This doesn't make sense.  How would you make a profit, by charging more than the price listed by Norek?  What happens if visitors to your site saw your listed price but then go ahead and login to Norek and see a lower price?  And even if you display a price for the item on your page, how will customers place an order?  They can not do that if you do not have shopping cart functionality built-in to your site.  

I think you need to re-think this whole idea.  If you want to sell products that really come from  another online seller, you should probably be seeking a formal affiliate relationship.  For example, if you applied to be an affiliate of Amazon.com and were approved, you would be issued a special code that becomes part of your URL.  Then, when you place links on your site that lead to Amazon.com and the customer makes a purchase, you get a small commission.  

Do a Google search on affiliate selling.
Let me clear things up a bit. Norek is a company that sells ONLY to businesses (ie. me). To view their prices I need to log into my Norek business account. Then I can decide what profit to add onto the Norek price.

Think of norek as the wholesaler, and me as the retailer.

My web page will initially NOT cater for online sales, I just want my "walk-in" customers to be able to see the prices I'm offering them.
Title: Re: JavaScript: Get info from other web pages
Post by: soybean on October 26, 2006, 12:30:15 PM
Once they see the price you're offering and they are interested, how would they place an order?
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 12:37:03 PM
Quote
Once they see the price you're offering and they are interested, how would they place an order?
Sorry, I should've made that clearer. I own an internet cafe, so once they've finished surfing they can just walk up to the counter and place their order through me. I would then log into Norek and place the order for them. They can pay at the counter.
Title: Re: JavaScript: Get info from other web pages
Post by: soybean on October 26, 2006, 12:58:56 PM
Can anyone register on Norek?  You say Norek is a wholesaler but, as far as I can tell, anyone can register on their site.  Could they then place an order?  

If Norek is a wholesaler, I presume they cater primarily to online retailers, such as you.  I would also think they have some information on their site to assist clients in selling online.  Is this not true?  

It seems to me Norek should not even be shown on your site.  You should have your own shopping cart, with product info you've setup.  Norek is in the background.  Your customers need not even know about Norek.  

Apparently, you want to avoid that approach.  You're trying to do this with as little effort as possible, right?
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 03:51:47 PM
Quote
Can anyone register on Norek?  You say Norek is a wholesaler but, as far as I can tell, anyone can register on their site.  Could they then place an order?  

If Norek is a wholesaler, I presume they cater primarily to online retailers, such as you.  I would also think they have some information on their site to assist clients in selling online.  Is this not true?  

It seems to me Norek should not even be shown on your site.  You should have your own shopping cart, with product info you've setup.  Norek is in the background.  Your customers need not even know about Norek.  

Apparently, you want to avoid that approach.  You're trying to do this with as little effort as possible, right?
Yes, I'm trying to do this with as little effort as possible ;).

As for anyone signing up for Norek.....no. You must produce official documents proving you are a business.

In time I will consider setting up a shopping cart, there seems to be plenty of software out there to help me. However, at the moment I want to start small. If I was to start selling online and couldn't cope with the demand I'd ruin my reputation as a seller.
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 26, 2006, 03:53:57 PM
talk to your web host and see what they offer software and script wise maybe they no of a script that you need.
Title: Re: JavaScript: Get info from other web pages
Post by: paulinnorway on October 26, 2006, 03:57:00 PM
Quote
talk to your web host and see what they offer software and script wise maybe they no of a script that you need.
I'll try that if I don't have any luck with the forums.
Title: Re: JavaScript: Get info from other web pages
Post by: Rob Pomeroy on October 31, 2006, 01:35:19 PM
You cannot possibly hope to do this with javascript.  And I think it's a much bigger job than you realise.

You would need a script on the server side, where the end user could not see what was going on, to grab the information from the wholesaler.  Who knows - if you're really lucky, they may have an API you can use.  Otherwise you're stuck with rather hard parsing problems.  Javascript is not up to that job.

I always vote for PHP.  It's not actually all that hard a move, if you're reasonably competent with javascript, and there are many amazing things you can do with PHP, including database access (which again might be something you'll be needing).

To put this all into context, my gut feeling is that you're looking at a couple of weeks of flat-out development for a job like this.  I guess you'd be paying a professional anything up to $2,000 for the job.  So you aren't going to get a complete solution, asking a few questions here I'm afraid.  But we could give you some pointers.

Your first pointer, if you really want to do this, is to learn PHP.  There are a lot of PHP tutorials out there.

JMO.
Title: Re: JavaScript: Get info from other web pages
Post by: unlovedwarrior on October 31, 2006, 01:59:19 PM
i dont know if this will work but maybe you can setup a shopping cart, so when someone orders something online and they finish putting their order information input the cart and press order that info will be sent to you and then you can order the items from your wholeseller and then add your extra price to the payment..(youll need to show the price with all of your stuff added in on your website before you do this) that way they dont know the what the wholesell price is only what your price is.


ie

the wholesell price is $10 but on your website it show $13 and when they add that to the price it goes into the shopping cart and then to your email and then you order it for them and shipp it to them..

just  thought, dont know if that is even possible, but im just throwing ideas out there to try to help you