Pre load plugin on php page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bobbkc
Forum Newbie
Posts: 6
Joined: Sat Aug 13, 2011 4:27 pm

Pre load plugin on php page

Post by bobbkc »

I have posted this already on the general php forum but think maybe I need this forum. I don't know if I am wording the question right but I have not been able to find an answer to this problem that I am having. I have an offsite plugin on my page that I have listed at the bottom. I have changed the domain to testsite so the link is not the actual link. This plugin works great after the page loads in both php and html but does not show up in the view source option. The only thing that shows up when I do a View Source from the tools is the script shown here at the bottom. I need the plugin to execute prior to the page loading so that the googlebot will be able to see the text and links that the plugin generates. What command or code would I use to have this plugin load prior to the page loading so the content will be available for view via the view source option? I have tried several methods from posts that somewhat similar discussions but they did not work. I am not a programer so I know just about enough to make me dangerous but I have created several php sites now so I am getting better. Thanks in advance for any input. Bob.

<script language="javascript">
var bid= 4575;
var site =2;
document.write('<script language="javascript" src="http://testsite.com/?bid='+bid+'&sitenu ... nt_results&'+ window.location.search.substring(1)+'"></' + 'script>');
</script>

In my previous post I got the suggestion to use <script language="javascript" src="http://testsite.com/?bid=4575&sitenumbe ... ults&<?php echo $_SERVER['QUERY_STRING']; ?>"></script> but even though this works it also is loaded after page itself is loaded. The only thing that shows in the View Source is the script shown here so the googlebot would not be able to pick up the text and links generated by the plugin. Do I need to put something in the header to state to run the script first and then have a query in the body to pull the information? Sorry for all of this trouble.
phphelpme
Forum Contributor
Posts: 261
Joined: Sun Nov 21, 2010 3:32 pm

Re: Pre load plugin on php page

Post by phphelpme »

What about:

Code: Select all

window.onload = function(){  } 
or maybe:

Code: Select all

<noscript></noscript>
Just an idea I am throwing out there.

Best wishes
Post Reply