开发者

SharePoint Designer - xmlHTTPRequest innerHTML

I have a sharepoint page that filters a data view from a query string in the address bar. I wanted to add further functionality by also returning back any of the files in the main sharepoint library that matches the query string in the address bar. I added a content editor webpart and I added a xmlHTTPRequest that imports the search page with the filtered results into the webpart div. If I use innerHTML = xmlhttp.responseText to p开发者_高级运维opulate the webpart div I receive an error message but when I change it to innerText I receive the text from the website. The error message I received was "Unkown runtime error".

var url = "searchresults.aspx?k=*.xlsx&v1=date&start1=1"  
xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET',url,false);
xmlhttp.onreadystatechange = function()
    {
        if(xmlhttp.readyState == 4);
                {
                   document.getElementById("dv_content").innerHTML = xmlhttp.responseText
                }
   }
xmlhttp.send(null);

Thanks, Anthony


Before going into the code, is the javascript running on the same virtual path as the searchresults.aspx file? Try putting the entire path first, like http://server/_layouts/searchresults.aspx?etc..


If I remember right, Unknown runtime error in IE is the rendering engine getting cranky about what you're trying to put into the element.

Here's some discussion on the subject.

I believe you'll need to massage the HTML you're trying to insert to something that IE is less surly about. You can do that either before or after you curse that browser's name.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜