Advertisement

03.04.2008 at 07:30AM PST, ID: 23212873
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.7

Returning SCRIPT With AJAX Approach (InnerHtml Not Enough)

Asked by jahlife in Active Server Pages (ASP), JavaScript, WebApplications

Tags: , ,

I have a containing page that is calling an ASP script using AJAX.  The results returned by updating the innerHtml of a div block are fine, but there is a SCRIPT block that is not being executed or is being filtered.

Please find attached, the SCRIPT block that I want to receive and execute using our AJAX event handlers.

Also attached are the two functions used to manage the AJAX call, note this line will need to be enhanced into code that will handle the incoming SCRIPT block in addition to HTML:

      document.getElementById(id).innerHTML = result;

I think the solution will include enhancements to our AJAX functions, perhaps using createElement and some additional steps to create and execute the SCRIPT block in addition to the innerHtml/HTML results.

If you need to see our ASP with the MP3 Player working outside of using AJAX, I can add some links.

Thanks in advance for any support.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
-----------------------------------------------------------------------
Our MP3 Player SCRIPT code that needs to be parsed and executed, the SQL result sets are generated by the ASP script that is called by the AJAX events.  (MP3 Player is a third party widget from dmxzone.com).
 
                            <SPAN ID="dv_flashMP3Player1"></SPAN>
                  <SCRIPT TYPE="TEXT/JAVASCRIPT">
 var flashMP3Player1 = new dmxMP3Player("micro", "fl_flashMP3Player1", "125", "16");
	flashMP3Player1.setScriptLibrary("/ScriptLibrary");
	flashMP3Player1.addVariable("mp3s", "<%=(ap_doc__selected.Fields.Item("doc_url_image_2").Value)%>");
	flashMP3Player1.addVariable("playerColor", "0x<%=(ap_bizamajig__meta_data__cache.Fields.Item("meta_data__ia_layout_public_article_accent_color__0x").Value)%>");
	flashMP3Player1.addVariable("startPlaying", "true");
	flashMP3Player1.addVariable("startVolume", "75");
 
     flashMP3Player1.write("dv_flashMP3Player1");
                  </SCRIPT>
-----------------------------------------------------------------------
Our AJAX functions are here:
 
function processArticleCategoryReview(url,callback) {
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	try {
		req.open("GET", url, true);
		req.onreadystatechange = function() {
// only if req shows "loaded"
			if (req.readyState == 4) {
// only if "OK"
				if (req.status == 200) {
					var temp = new Array();
					temp.push(req.responseText);
					callback.apply(callback,temp);
				} else {
					alert("There is a problem connecting to the internet: \n" + req.statusText);
				}
			}
		};
	req.send(null);
	} catch(e) {
		alert(e.message);
	}
}
function setDocSectionArticleReview(url,id) {
	var callback = function(result) {
	document.getElementById(id).innerHTML = result;
	}
	processArticleCategoryReview(url, callback);
}
 
Keywords: Returning SCRIPT With AJAX Approach…
 
Loading Advertisement...
 
[+][-]03.04.2008 at 08:08AM PST, ID: 21042226

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.04.2008 at 08:27AM PST, ID: 21042411

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.04.2008 at 11:02AM PST, ID: 21043917

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), JavaScript, WebApplications
Tags: ASP, JS, IE, Firefox, Safari, bizamajig.com/franksouthecorvo
Sign Up Now!
Solution Provided By: pnoeric
Participating Experts: 1
Solution Grade: B
 
 
[+][-]03.04.2008 at 12:10PM PST, ID: 21044577

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628