Forum Thread

JavaScript - HTML question

yotafan 2,575 764 November 12, 2015 at 09:04 AM
This can be a noob question but i have no idea.

I want to know how to change an html page based on the content of another page. Basically we have 25 offices that have their own pages and 1 index page that lists those offices pages. What i would like is if one of those 25 pages or if multiple have certain verbiage put on their page for something to happen on the index page.


Such as if an office is closed or delayed and they post that on their specific page. Then i would assume a javascript could read the content of that page and then edit the index page. Any guidance is greatly appreciated, if you have any questions please let me know.

TIA
Ed

8 Comments

1

Sign up for a Slickdeals account to remove this ad.

Joined Mar 2009
Schrödinger's Frog
17,351 Posts
2,025 Reputation
#2
It may be possible to do this with Javascript, but it doesn't seem like the right tool for the job. I'd say you probably want to look at using a proper programming language (.Net or the likes).
Reply Helpful Comment? 0 0
#3
Uh...this is so complex that I dont even know how to answer.
You are definitely in the wrong section if you want more details.

What do you mean their own page? Meaning different domain?
If it is the same domain, then you can just share a database and output those information via server side.

If it is different domain, then your offices would need to transmit these data cross domain through server side ('Access-Control-Allow-Origin'), via JSONP, or jQuery Load function and more.

If you just want to use javascript (jQuery) to read the webpage, http://james.padolsey.com/javascr...th-jquery/ is a good tutorial.

If you have never coded, i would advice against you trying to solve the problem
Reply Helpful Comment? 0 0
Last edited by xxtanisxx November 12, 2015 at 11:44 AM
Joined Mar 2009
Schrödinger's Frog
17,351 Posts
2,025 Reputation
#4
Quote from xxtanisxx View Post :
Uh...this is so complex that I dont even know how to answer.
You are definitely in the wrong section if you want more details.

What do you mean their own page? Meaning different domain?
If it is the same domain, then you can just share a database and output those information via server side.

If it is different domain, then your offices would need to transmit these data cross domain through server side ('Access-Control-Allow-Origin'), via JSONP, or jQuery Load function and more.

If you just want to use javascript (jQuery) to read the webpage, http://james.padolsey.com/javascr...th-jquery/ is a good tutorial.

If you have never coded, i would advice against you trying to solve the problem
Iagree
Reply Helpful Comment? 0 0
#5
To me it sounds like you'd be better off using php and probably an off the shelf open source content management system.

Are these pages public or is this on a corporate intranet?
Reply Helpful Comment? 0 0
Joined Jun 2006
L7: Teacher
2,575 Posts
764 Reputation
Original Poster
#6
TY for the replies and sorry i was confusing with what i initially posted.

Think of it as a bank with Headquarters and 20 branch locations. It is all the same domain and HQ has primary access to all the sites/pages. The branch offices access a url that prompts them for a username and pw that runs a .cgi script that loads their specific page and only their page.

The main page links to all the branch locations, i had the idea people could just look at the main page and there be some extra text based on what the branch page displays.

This was just a thought i had among many others.
Thank you all and repped.
Reply Helpful Comment? 0 0
Learn the truth about assault weapons: http://www.assaultweapon.info
#7
Quote from yotafan View Post :
Think of it as a bank with Headquarters and 20 branch locations. It is all the same domain and HQ has primary access to all the sites/pages. The branch offices access a url that prompts them for a username and pw that runs a .cgi script that loads their specific page and only their page.

The main page links to all the branch locations, i had the idea people could just look at the main page and there be some extra text based on what the branch page displays.

This was just a thought i had among many others.
Thank you all and repped.
It's certainly doable, javascript and cgi just aren't the best tools for the job.

Just move the entire website to a content management system, possibly something like drupal or maybe something simpler. No point in reinventing the wheel.
Reply Helpful Comment? 0 0
Joined Dec 2007
L10: Grand Master
7,632 Posts
1,489 Reputation
#8
Quote from yotafan View Post :
TY for the replies and sorry i was confusing with what i initially posted.

Think of it as a bank with Headquarters and 20 branch locations. It is all the same domain and HQ has primary access to all the sites/pages. The branch offices access a url that prompts them for a username and pw that runs a .cgi script that loads their specific page and only their page.

The main page links to all the branch locations, i had the idea people could just look at the main page and there be some extra text based on what the branch page displays.

This was just a thought i had among many others.
Thank you all and repped.
Sounds like you could get away with this in Sharepoint. Then each office can have their own sharepoint page and depending on their login determines which page loads for which office.
Reply Helpful Comment? 0 0

Sign up for a Slickdeals account to remove this ad.

#9
Quote from yotafan View Post :
TY for the replies and sorry i was confusing with what i initially posted.

Think of it as a bank with Headquarters and 20 branch locations. It is all the same domain and HQ has primary access to all the sites/pages. The branch offices access a url that prompts them for a username and pw that runs a .cgi script that loads their specific page and only their page.

The main page links to all the branch locations, i had the idea people could just look at the main page and there be some extra text based on what the branch page displays.

This was just a thought i had among many others.
Thank you all and repped.
I mean it is doable. Not the most effective, but sure.

I would suggest that you have each branch output json response on URL publicly like { 'time':'delay', 'start':'9/3/2044'}
Then take the code using ajax jsonp to request for it. (if you want the information private, you can definitely use jsonp to login and such.)
Then cgi the script to run every 10 mins or something.

It might work, but for more details, you would definitely need to research them.
Reply Helpful Comment? 0 0
Page 1 of 1
1
Join the Conversation
Add a Comment
 
Copyright 1999 - 2016. Slickdeals, LLC. All Rights Reserved. Copyright / Infringement Policy  •  Privacy Policy  •  Terms of Service  •  Acceptable Use Policy (Rules)  •  Interest-Based Ads
Link Copied to Clipboard