simple script wanted calling from external page

R

richard

The layout is simple.
3 columns.
1) navigation
2) items to select
3) display information

I have found a script that calls up individual pages for the displayed
information. However, in my case, that would require over a thousand very
small files to write and load.

What I am needing is a way to call an idividual division from an external
page. So that I could have say fifty divisions on one page. When an item is
clicked on, only that corresponding division on the external page is shown.

Anyone have such a script?
I'd also be willing to hire someone to write one.
 
V

VK

I have found a script that calls up individual pages for the displayed
information. However, in my case, that would require over a thousand very
small files to write and load.

What I am needing is a way to call an idividual division from an external
page. So that I could have say fifty divisions on one page. When an item is
clicked on, only that corresponding division on the external page is shown.

You need to define better the "division". Is it a DIV/P/TR/whatever
with a unique id? Something else uniquely identifiable on the well-
formed source page? Then on click just load the entire page over XHR
(a.k.a. Ajax) as XML, extract the needed node with children, convert
to HTML and add to the DOM. It doesn't matter that the same page will
be requested X times for different divisions. Unless server headers
and/or XHR code specially crafted, each page will be actually loaded
only once, on the first request.
Until the "division" is not clarified it is rather pointless to
propose code snippets.
 
R

richard

You need to define better the "division". Is it a DIV/P/TR/whatever
with a unique id? Something else uniquely identifiable on the well-
formed source page? Then on click just load the entire page over XHR
(a.k.a. Ajax) as XML, extract the needed node with children, convert
to HTML and add to the DOM. It doesn't matter that the same page will
be requested X times for different divisions. Unless server headers
and/or XHR code specially crafted, each page will be actually loaded
only once, on the first request.
Until the "division" is not clarified it is rather pointless to
propose code snippets.

On the external page, the items will be spearheaded with
<div id="nameX">content</div>.
Where nameX corresponds to the item identifier in the link.
 
P

P E Schoen

"VK" wrote in message
You need to define better the "division". Is it a DIV/P/TR/
whatever with a unique id? Something else uniquely identifiable
on the well-formed source page? Then on click just load the
entire page over XHR (a.k.a. Ajax) as XML, extract the needed
node with children, convert to HTML and add to the DOM
It doesn't matter that the same page will be requested X times
for different divisions. Unless server headers and/or XHR code
specially crafted, each page will be actually loaded
only once, on the first request. Until the "division" is not clarified
it is rather pointless to propose code snippets.

That is like using an HTML page as a database. I suppose it can be done, but
it sounds very inefficient. It seems much easier to create and maintain a
simple database server-side, and simply make a PHP or Perl script that
extracts the requested record via the CGI vars and then creates and displays
a pop-up or a CSS modal window as discussed elsewhere. But that's not
JavaScript.

Richard:
I made a simple demo on my server and you are welcome to try it. I'll
provide source code if you're interested. This PHP script incorporates
optional password authorization which will allow adding emails from the CGI
variables "name" and "email".

The password for this demo is "YourPassword".

http://www.pauleschoen.com/bgf/BGFemailDemo.htm

I may take this down in a couple of days, so let me know if you want details

Paul
 
S

Scott Sauyet

richard said:
What I am needing is a way to call an idividual division from an external
page. So that I could have say fifty divisions on one page. When an item is
clicked on, only that corresponding division on the external page is shown.

This is not particularly difficult to do. Here is a simple example
that uses jQuery:

http://scott.sauyet.com/Javascript/Test/2011-02-22a/

But it should be easy enough to do with most any toolkit, or with your
own simple AJAX and DOM manipulation tools. Of course this could be
written with much more sophisticated features, such as caching, or
complicated relationships between the href and the actual url that's
called, but the basics are there.

Good luck,

-- Scott
 
R

richard

This is not particularly difficult to do. Here is a simple example
that uses jQuery:

http://scott.sauyet.com/Javascript/Test/2011-02-22a/

But it should be easy enough to do with most any toolkit, or with your
own simple AJAX and DOM manipulation tools. Of course this could be
written with much more sophisticated features, such as caching, or
complicated relationships between the href and the actual url that's
called, but the basics are there.

Good luck,

-- Scott

Thank you sir. That is exactly what I am looking for. Now I can easily
reduce the overhead on the main page and just go to town as I need.

Your method also reduces all the clutter usually present in the <a> tag.
As the saying goes, "Apply the KISS rule as often as possible" and you did.

Keep
It
Simple,
Stupid
 
R

richard

This is not particularly difficult to do. Here is a simple example
that uses jQuery:

http://scott.sauyet.com/Javascript/Test/2011-02-22a/

But it should be easy enough to do with most any toolkit, or with your
own simple AJAX and DOM manipulation tools. Of course this could be
written with much more sophisticated features, such as caching, or
complicated relationships between the href and the actual url that's
called, but the basics are there.

Good luck,

-- Scott

Most odd that nothing seems to work locally.
I saved my base file to correspond to your href tag. Gave the division ID
the same ID and still nothing shows.
I am online so a connection should not be the problem.
 
R

richard

"P E Schoen" wrote in message

And you need to use a http://localhost server, or change the URLs to Windows
backslash style for unhosted local use.

Paul

I figured that was the case. I uploaded the files and they work just fine
online.
So maybe now I will get this puppy done the way I want.
 
R

richard

This is not particularly difficult to do. Here is a simple example
that uses jQuery:

http://scott.sauyet.com/Javascript/Test/2011-02-22a/

But it should be easy enough to do with most any toolkit, or with your
own simple AJAX and DOM manipulation tools. Of course this could be
written with much more sophisticated features, such as caching, or
complicated relationships between the href and the actual url that's
called, but the basics are there.

Good luck,

-- Scott

http://1littleworld.net/sample/indexa.htm

Got it to work. But only the first four items show up.
What am I missing?
 
P

P E Schoen

"richard" wrote in message
Got it to work. But only the first four items show up.
What am I missing?

http://1littleworld.net/sample/groupB.html Not Found.

I still think a database would be the best way to do this, but what might
seem best to me may not be for you. As long as you accept the maintenance
problems that may be caused by this data structure, and it works for you,
then that's the bottom line.

This is an interesting project. The 1960s decade was very important for me,
as it represented my early adolescence to the beginning of my adulthood, and
the music was a huge part of that. It represented the most prolific and
innovative era in music history as well as the culmination of an entire
generation's change of focus from social conformity and established customs
and morality, to the acceptance and promotion of an entirely different way
of thinking and living.

So, good luck, and keep us posted on your progress. I'd be interested in
availing myself of this rich repository of data. But it would probably be
much more useful if it had a search and filter function, which would best be
accomplished with an SQL statement for a database.

Paul
 
R

richard

"richard" wrote in message


http://1littleworld.net/sample/groupB.html Not Found.

Of course, because it does not exist.

http://1littleworld.net/sample/indexa.html

Forgot I changed the name slightly. Should work now.

I still think a database would be the best way to do this, but what might
seem best to me may not be for you. As long as you accept the maintenance
problems that may be caused by this data structure, and it works for you,
then that's the bottom line.

Working on that too.
More or less experimenting with what works best.
This is an interesting project. The 1960s decade was very important for me,
as it represented my early adolescence to the beginning of my adulthood, and
the music was a huge part of that. It represented the most prolific and
innovative era in music history as well as the culmination of an entire
generation's change of focus from social conformity and established customs
and morality, to the acceptance and promotion of an entirely different way
of thinking and living.

So, good luck, and keep us posted on your progress. I'd be interested in
availing myself of this rich repository of data. But it would probably be
much more useful if it had a search and filter function, which would best be
accomplished with an SQL statement for a database.

Paul

I got started on this a couple of years ago when I first got hooked on
Liberty Basic, and it's offshoot, "Run Basic".
I had found the weekly charts at "Cashbox magazine" and decided to build a
site showing all the song names and artists in alphabetical order.

I wrote a program that would take the weekly charts, strip the html, then
sort the names as I needed.

Now that I have billboard's weekly charts as well, which is image based, I
am slowly converting that to text files.

I will be getting around to doing all of this in mysql eventually.
 
R

richard

This is not particularly difficult to do. Here is a simple example
that uses jQuery:

http://scott.sauyet.com/Javascript/Test/2011-02-22a/

But it should be easy enough to do with most any toolkit, or with your
own simple AJAX and DOM manipulation tools. Of course this could be
written with much more sophisticated features, such as caching, or
complicated relationships between the href and the actual url that's
called, but the basics are there.

Good luck,

-- Scott

http://1littleworld.net/sample/indexa.html

Would help if I used the right page.
 
R

richard

"richard" wrote in message


http://1littleworld.net/sample/groupB.html Not Found.

I still think a database would be the best way to do this, but what might
seem best to me may not be for you. As long as you accept the maintenance
problems that may be caused by this data structure, and it works for you,
then that's the bottom line.

This is an interesting project. The 1960s decade was very important for me,
as it represented my early adolescence to the beginning of my adulthood, and
the music was a huge part of that. It represented the most prolific and
innovative era in music history as well as the culmination of an entire
generation's change of focus from social conformity and established customs
and morality, to the acceptance and promotion of an entirely different way
of thinking and living.

So, good luck, and keep us posted on your progress. I'd be interested in
availing myself of this rich repository of data. But it would probably be
much more useful if it had a search and filter function, which would best be
accomplished with an SQL statement for a database.

Paul

http://www.globaldogproductions.info/

Has information based upon the numerous labels.
 
S

Scott Sauyet

richard said:
This is not particularly difficult to do.  Here is a simple example
that uses jQuery:
Thank you sir. That is exactly what I am looking for. Now I can easily
reduce the overhead on the main page and just go to town as I need.

I'm glad it works for you. As PE said, it sounds as though this would
best be done with a database, but this might give you at least a stop-
gap.

-- Scott
 
D

Dr J R Stockton

Tue said:
What I am needing is a way to call an idividual division from an external
page. So that I could have say fifty divisions on one page. When an item is
clicked on, only that corresponding division on the external page is shown.


Presuming that the external page is HTML or TXT (I've tries no others)
in the same domain as your main page, you can read the external page
into an /iframe/ in the main page (hidden, if you like), and access the
content of that as written, as a string. With that, you can do all that
you can think of.

Alternatively, you could use an include file of the form
var Seg001 = "Text of Segment 001"
var Seg002 = "Text of Segment 002"
var Seg003 = "Text of Segment 003"
...

In either case, you can have more than one external page and load only
which is needed, like picking only the required volume of the OED off
the shelf. A sports page could have includes for, say, "cricket",
"curling", "gurning", "dwile flonking" and so on.


You will, though, need to learn some JavaScript.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top