www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] - noob question- Ajax.updater & other scripts - PLS help

  1. #1
    Join Date
    Aug 2008
    Location
    Chicago, IL
    Posts
    7

    resolved [RESOLVED] - noob question- Ajax.updater & other scripts - PLS help

    Hello,

    I'm using ajax.updater of prototype framework to call upon an html page to load in my DIV. The html page that i'm calling upon has another script on it, i.e. AddThis button (http://www.addthis.com)...on it's own the page works fine, but when i call upon it, AddThis Button doesn't work.

    Below is the portion of the code where ajax.updater is being used...I tried reading prototype documentation and follow other samples that i've found online...but nothing.

    Ajax.updater:

    Code:
    <script>
    	function updateWithFile(file){
    		var url = file;
    		var pars = '';
    		var myAjax = new Ajax.Updater(
    				'glow', url,
    				{method: 'post', parameters: pars, evalScripts: ''});
    	}
    	addEvent(window, 'load', function() {
    		updateWithFile('home.html')
    	});
    	function addEvent(obj, evType, fn){
    	 if (obj.addEventListener){
    		obj.addEventListener(evType, fn, true);
    		return true;
    	 } else if (obj.attachEvent){
    		var r = obj.attachEvent("on"+evType, fn);
    		return r;
    	 } else {
    		return false;
    	 }
    	}
    	var myGlobalHandlers = {
    		onCreate: function(){
    			Element.show('loadingdiv');
    		},
    		onComplete: function() {
    			if(Ajax.activeRequestCount == 0){
    				Element.hide('loadingdiv');
    			}
    		}
    	};
    	Ajax.Responders.register(myGlobalHandlers);
    </script>
    AddThis button:
    Code:
    <td><!-- ADDTHIS BUTTON BEGIN -->
    				<script type="text/javascript">
    addthis_pub             = 'account name has been hidden'; 
    addthis_logo            = 'hidden images/add_logo.png';
    addthis_logo_background = 'EFEFFF';
    addthis_logo_color      = '666699';
    addthis_brand           = 'Branding name';
    addthis_options         = 'favorites, email, digg, delicious, myspace, facebook, google, live, more';
    </script>
    				<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="image used as a button goes here" width="164" height="101" border="0" alt="" /></a>
    				<script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
    				<!-- ADDTHIS BUTTON END -->
    Thank you very much in advance.

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,360
    when it comes to frame works, you at the whim of the developer of the framework.

    IMHO you would be better off scripting your own routines than relying on others works that may be buggy.

    If you insist on using a framework then it would be quicker for you to get your help from vendors help forum, you may be lucky and someone here with experience of these frame works could possibly answer you.

    You will find reading in the web search results for help on this prototype.js will yield plenty of results with users complaining about issues, not being able to use these frame works because of compatibility issues and so on.

    Scripting your own Ajax routine should take you no more than 10 minutes (assuming you have prior coding skills), far quicker than messing around with prototype.js and finding a resolution to your problem and waiting for a patch for it.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  3. #3
    Join Date
    Jul 2005
    Location
    USA
    Posts
    912
    Bump
    Last edited by Webnerd; 12-24-2008 at 08:36 PM. Reason: BUMP - Didn't see HTML - Need more time for solution
    Bitter web veteran

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



Recent Articles