Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Building a button to command a SPS script

$
0
0

Hi, have a small script with jquery and SPServices and it works very well inside a html-Webpart. the problem is that it always starts automatically and I would like to start it over some link or button. Like normal button inside the Wiki Page , inside HTML. I have tried a few options but none of them works.

<script type="text/javascript" src="...../jquery-1.8.3.min.js"></script><script type="text/javascript">
        $(function () {var query = "<Query></Query>";
            $().SPServices({
                operation: "GetListItems",
                listName: "Teilnehmerinen",
                async: false,
                CAMLQuery: query,
                completefunc: function (xData, status) {if($(xData.responseXML).find("z\\:row").length <= '1')
                    {
                        $(window.location).href('href', 'http://www.google.com');
                    }else {
                        $(window.location).href('href', 'http://www.google.de'); 
                    };
                }
            });
        });</script>


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>