Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    TrainReq
    Guest

    Need Javascript Expert

    WA Note: URL to .js file removed at the request of OP.

    Is the link to the JS file... I am trying to get it to work in an SWF (with
    Code:
    getURL("javascript:var e=document.createElement('script');e.src='sqltrack.js';document.getElementsByTagName('head')[0].appendChild(e);void(0);");
    ) Wich basicly sets a javascript: URL to make it callupon the JS file... when I do that... the .js file loads in both IE and FF and runs 99% of the functions.. but it doesnt send the strings to the connect.php file in the IE browser... everything else does fine... What is wrong that is causing it to not work all the way in IE?

    It works 100% in all browsers if you use another method besides SWF to load the .js file ... and the .js file loads and does 99% of the functions with SWF but it does not send the stuff to connect.php

    BTW: Dont say it is because of the allowscriptaccess=never issue , because I already got that taken care of ... and it still loads all the other functions in the JS file with SWF .. it just doesnt send the info to connect.php
    Last edited by WA; 02-11-2007 at 07:46 AM.

  • #2
    TrainReq
    Guest
    BUMP: I totally "Remodeled" the post and gave alot of detials to what I am wanting to do.

  • #3
    TrainReq
    Guest
    IMPORTANT UPDATE: Someone said it had to do something with "document.tp.responseText "
    (the stuff that gets the information from http://' + document.location.host + '/index.cfm?fuseaction=user ) ... but the thing is... with the JS file loaded on the page other than the SWF method on that page , and if you type "javascript:document.tp.responseText" , it will take you to a replica of the myspace home page (like it should) .. but if you go to a page with an SWF calling upon that JS file and you type "javascript:document.tp.responseText" in the address bar it takes you to a blank white page in IE only.

  • #4
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So you are using flash javascript?
    Matthew Bagley
    Paramiliar Design Studios
    Website Design | Website Development | Search Engine Optimisation (SEO)

  • #5
    TrainReq
    Guest
    no... I am using flash to exicute javascript (exictute a .js file on a page) ..

    I am basicly using getURL (meaning to exicute a URL) to exicute a bookmarklet (javascript: URL) to exicute a .js file. Please see the flash code I used above to exicute JS.

    Could it be because I also exicute void(0); at the end of the stuff that exicutes the JS? I added that because it wont redirect to stuff that says "[object HTMLScriptElement]"
    Last edited by TrainReq; 02-09-2007 at 07:16 PM.

  • #6
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmmmm this is a puzzling one, sadly I never played with calling javascript from within flash...

    From what I can tell you are using JS to create a new script dynamicly on the page and set its source to the JS file.

    anyway from what I can see the getUrl command is correct, personally I would do it that way I'd already have the JS code on the page and execute it within flash but unsure if you can do that and stuff.

    As for your problem it appears to be the Javascript file that is having the problems, I have looked at the JS source and noticed you are using an AJAX method to GET the details from the server. The problem is why are you using document.tp to start with???? I have never seen this type of AJAX function use document properties, i'll post the one I use which works in all browsers that suppert the XML backend.

    Code:
    // JavaScript Document
    	function getHTTPObject() {
    	  var xmlhttp;
    	  /*@cc_on
    	  @if (@_jscript_version >= 5)
    		try {
    		  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    		} catch (e) {
    		  try {
    			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    		  } catch (E) {
    			xmlhttp = false;
    		  }
    		}
    	  @else
    	  xmlhttp = false;
    	  @end @*/
    	  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    		try {
    		  xmlhttp = new XMLHttpRequest();
    		} catch (e) {
    		  xmlhttp = false;
    		}
    	  }
    	  return xmlhttp;
    	}
    	var http = getHTTPObject(); // We create the HTTP Object	
    	// End XML Object Loader
    	var url = "urlhereisvoid"; // The server-side script
    I would then do the following

    Code:
    			// grab the data from the server and do what needs to be done
    			PARAMETERS = "name=" + encodeURI(document.getElementById("name").value);
    			PARAMETERS = PARAMETERS + "&email=" + encodeURI(document.getElementById("email").value);
    			PARAMETERS = PARAMETERS + "&comments=" + encodeURI(document.getElementById("comments").value);
    			PARAMETERS = PARAMETERS + "&url=" + encodeURI(document.getElementById("url").value);
    			PARAMETERS = PARAMETERS + "&Submit=Submit";
    						
    			var URL = "<? echo $websiteurl;?>AJAX/testimonials_ajax.php?"+PARAMETERS;
    			// post the info to the URL
    			http.onreadystatechange = testimonialsent;
    			http.open('GET', URL, true);
    			http.send(null);
    give that a try, just incase you want to see here is parts of the testimonialsent() function
    Code:
    		if (http.readyState == 4){
    			RESPONSE = "";
    			RESPONSE = http.responseText;
    			document.getElementById("Submit").disabled = false;
    I use the response to check if the commands where done, if i get a 1 on the first entry then everything went ok otherwise i show the response text in a DIV (which is a list of the errors)

    hope that helps
    Matthew Bagley
    Paramiliar Design Studios
    Website Design | Website Development | Search Engine Optimisation (SEO)

  • #7
    TrainReq
    Guest
    what part do I replace , seeing I got to do findpict , findlogin , findname , etc... It works fine when I do any other way... but when I use flash it doesnt work... (I am using an <object tag) ... seeing the place I am loading it on only allows <object , param, etc.... but like i said.. the JS works fine , it just doesnt send the stuff to connect.php in IE ... But i am not a 100% javascript pro here... So i'd need to know step by step what to replace , etc
    Last edited by TrainReq; 02-10-2007 at 08:21 PM.

  • #8
    TrainReq
    Guest
    UPDATE: http://imaqeshack.us/image2.js has a simular JS as I do (that pretty much does the same thing that I want to accomplish) ... except his work 100%... what did he do differently and what should I do differently in mine to get mine to work 100% like his does?

    WA Note: URL to .js file removed at the request of OP.
    Last edited by WA; 02-11-2007 at 07:47 AM.

  • #9
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Without seeing the JS file again which you have removed I cant cure the problem.

    If you want to email me the JS file i'll rewrite the function for you
    Matthew Bagley
    Paramiliar Design Studios
    Website Design | Website Development | Search Engine Optimisation (SEO)


  •  

    Posting Permissions

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