Results 1 to 7 of 7

Thread: Can Javascript Pull content from a Window.Open page?

  1. #1
    Join Date
    Aug 2009

    Can Javascript Pull content from a Window.Open page?

    I'm a newbie to javascript and web development in general. First, let me say that this is just an attempt at a workaround until I learn how to use php and MySQL. Here's the scenario:

    <----- SCENARIO ----->
    I sell musical arrangements online. The catalog has hundreds of items. Each item has about a dozen pertinent fields: top-level specifying an ID, Song Title, Group Size, Style, et cetera; and details, specifying specific instruments for a particular arangement.

    The previous version of my website simply contained links to pdf files with lists (the top level detail only)

    For the redesign, I'm trying to give the visitor more info and also allow the visitor to select specific titles to add to an order.

    The source date is from a Microsoft Access database. I have written some Visual Basic that reads the source data table and produces HTML code for a table that contains the desired info.

    The size of the table is way too big to put into the window, so here's what I'd like to do if javascript can do it. Note that the data IS STORED in a separate .htm file but that file is not accessible to the viewer.

    (1) In my Catalog.htm page, include an Body Onload function that opens the .htm file with the data using a window.open() method;
    (2) Read and save the data in an array in javascript. Then close this window.
    (3) Allow the user to specify what song titles to show in the Catalog page by setting criteria in a form on that page;
    (4) Load only the top-level info that matches his query for up to10 titles at a time as content in specific tagged elements on the Catalog page.
    (5) Use mouseover to display a popup with the detailed info for any of the titles.

    <---- WHAT I DON'T KNOW ----->
    (1) Can javascript called by one window read data from another window? If so, what is the method for doing this?
    (2) If (1) can be done, will the data read be persistent for as long as the Catalog window/page is open?

    Thanks in advance for any help


  2. #2
    Join Date
    Aug 2009
    Yes, use xml http object.

  3. #3
    Join Date
    Aug 2009

    Re your reply to "Can Javascript Pull content from a Window.Open page? "

    Sorry, but that answer is very cryptic. Can you expand it, please, to describe what you're trying to tell me in more detail. Use XML http object for what?



  4. #4
    Join Date
    Dec 2002
    Pleasanton, CA
    Quote Originally Posted by TDinDC View Post
    Note that the data IS STORED in a separate .htm file but that file is not accessible to the viewer.
    If it's in .htm file in the webroot directory, it's veiwable by anybody.

    If you can do (5) in the upper list then (1) in the lower list should be easy.
    and yes, the data will be persistent if I'm reading that right.

    So what do you need help with?
    I'm thinking you need help with all of this.
    Try google for 'shopping carts'. They have a lot of the functionality you are looking for. This is a fairly advanced task requiring some sort of server-side scripting as well as client-side javascript.

  5. #5
    Join Date
    Aug 2009

    Nedals: Re your response to "Can Javascript Pull content from a Window.Open page? "

    Thanks Nedals,

    I guess I misspoke when I said it couldn't be viewed - it simply doesn't show up on navigation and I don't expect that any visitor to my site would go looking for it - they simply want to know what products I have to offer. They're just bandleaders looking for arrangements, and finally I don't care if they look at it - the catalog is HUGE, unwieldy in the browser, and it's structure is more suited to a relational database solution. That's why I said in my original post that this is just an interim solution that I'll eventually implement with php and MySQL.

    You're probably right that I need help with all of this, however I'm having fun and working on this to learn as I go:

    - I'm recently retired from a 35+ year technical career from R&D to Systems Engineering (stayed clear of management, thank God!)
    - Now I'm back to my music business full time - a luxury I didn't have when I worked a 9-to-5.
    - I've always been a quick learner in about whatever I tried to do (but I'm still a newbie in newer web technologies)
    - I designed my original website about 8 years ago when my musical projects were first getting off the ground (I was a professional musican for ten years before moving over to technical fields)
    - At the time, I used FrontPage because its basically an easy to use WYSIWYG tool, but it doesn't write W3 DOM compliant code, so I'm redoing everything:
    (a) to design a much slicker website with the hopes of attracting more business,
    (b) to learn and incorporate newer capabilities, and
    (c) for fun and the never ending quest to learn something new

    So, I've inundated myself with learning javascript, php, and other new 'stuff' on my own. I can and will learn what I need, I'm not in a big hurry, and I look at developer forums like this as a invaluable resource to point me in the right direction. For example, after reading fuadr's cryptic response (last night I didn't know what an XML HTTP object was, nor how it could be used. But since then I've done some research and probably could write the javascript to pull xml-formatted data from a document on the server.)

    Bottom line - this is all good.

    Again, thanks;


  6. #6
    Join Date
    Apr 2008
    There is no need for XMLhttp, at least in Firefox it's possible to just use standard DOM on opened windows.

  7. #7
    Join Date
    Dec 2002
    Pleasanton, CA
    Since you are learning and want to try things, you could start with...

    On a starting page, enter some data that will be used for a search

    Use Ajax to read your 'database .html page' and, based on the above input, extract the info you want. You may need to re-organize this page. I would change it to a .CSV file and organize it the same way that your future database will be organized.

    Then use something like 'GreyBox' to display the content. You will not need a popup, and it's much prettier.

    Have fun.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.14307 seconds
  • Memory Usage 2,908KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (7)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates