Results 1 to 6 of 6

Thread: Can external javascript process my URLs?

  1. #1
    Join Date
    May 2011

    Can external javascript process my URLs?

    I have a 900+ row MySQL database, comprising 15 categories of site_name and URL details, dynamically accessed using a series of selects. These pages retrieved by these URLs are copied into the main contents frame of my home page. I am receiving a healthy number of hits each day but am unable to determine which links are most/least popular.
    I have hit the problem of storing the contents of parent.contents.location.href for further use I would like to either write them to a text file or directly back into MySQL for analysis purposes.

    The select code follows:
    (The $a is passed into the function as the value of site_code, which is not retrieved)

    $result_recordset=$db->Execute("select distinct site_name,site_link
    from site_list
    where site_code='$a'
    and site_name is not null
    and active = 'Y'
    order by site_name");
    <FORM action="get">
    <select onChange="parent.contents.location.href=options[selectedIndex].value;">
    echo("<option value ='".$result_recordset->fields['site_link']."'> ".$result_recordset->fields['site_name']);

    Is there any realistic chance of being able to pass the URL to an external javascript or php file for processing and preservation or am I flogging a dead horse and should consider a total rethink? I have no access to ASP or VB so am confined to PHP/Javascript/MySQL (not really a limitation!)
    The use of a separate SUBMIT button to perform a GET or POST would not suit the architecture as it now exists.

    Thanks for any help you guys can offer.

  2. #2
    Join Date
    Dec 2002
    St. Louis, MO, USA
    You could set the onChange to go to an HTML or PHP page with the site URL as a parameter, do whatever javascript or PHP you want with it, then redirect to the site.
    o . Q
    ___ "You live and you learn; or you don't live long." - Lazarus Long


  3. #3
    Join Date
    May 2011
    I didn't know whether an 'intermediate page' would do the trick. I guess you mean to use it as a 'black box' and 'dump' the data there en-route to the 'proper page' that would possibly solve things. Thanks for that! I'll give it a whirl.

  4. #4
    Join Date
    Jul 2008
    urbana, il
    use anchors instead of onclicks so you can use the ping attrib.

    or, simply add google analytics to each page review the nice colorful graphs of visitor stats google provides for free.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  5. #5
    Join Date
    Dec 2002
    St. Louis, MO, USA
    Well... I don't know about 'black box'; but 'dumping' the data sounds about right.

    The important thing is that everything except going to the site URL will be behind the scenes; and unless there is a TON of data, or a lousy internet connection, or something bottlenecking the data, it should process invisibly to the user - from their point of view, it just goes to that site, nothing more.
    o . Q
    ___ "You live and you learn; or you don't live long." - Lazarus Long


  6. #6
    Join Date
    May 2011
    Thanks for the suggestions guys. Sorry about the late reply. I think my ISP has an issue with superglobals like $_GET, having upgraded to PHP5, so I'm trying to either get them turned back on or I'll have to have a workaround.
    I'll keep you posted on the eventual solution but I'm looking at getting the data passed to a javascript function using "this" and then calling the external php page from there having assigned parent.location.href to Result and passing

    location.href="page2.php?Result=" + Result;

    to the external php.

    This is new territory for me....trying to 'marry' client-side and server-side seems like a minefield!

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.10799 seconds
  • Memory Usage 2,890KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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 (73):
  • 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_postinfo_query
  • fetch_postinfo
  • 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
  • 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