File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11
11
}
12
12
13
13
window . getPaginationAnchors = ( pages ) => {
14
- var pageAnchors = '' , searchTerm = window . location . search . split ( "=" ) [ 1 ] . split ( "&" ) [ 0 ] ;
14
+ var pageAnchors = '' , searchTerm = window . location . search . split ( "=" ) [ 1 ] . split ( "&" ) [ 0 ] . replace ( / % 2 0 / g , ' ' ) ;
15
15
var currentPage = window . location . search . split ( "=" ) [ 2 ] ;
16
16
currentPage = ( ! currentPage ) ? 1 : currentPage . split ( "&" ) [ 0 ] ;
17
17
33
33
}
34
34
35
35
window . renderBingSearchResults = ( ) => {
36
- var searchTerm = window . location . search . split ( "=" ) [ 1 ] . split ( "&" ) [ 0 ] ,
36
+ var searchTerm = window . location . search . split ( "=" ) [ 1 ] . split ( "&" ) [ 0 ] . replace ( / % 2 0 / g , ' ' ) ,
37
37
page = window . location . search . split ( "=" ) [ 2 ] ,
38
38
q = "site:kubernetes.io " + searchTerm ;
39
39
47
47
ajaxConf . beforeSend = function ( xhr ) { xhr . setRequestHeader ( 'Ocp-Apim-Subscription-Key' , '51efd23677624e04b4abe921225ea7ec' ) ; } ;
48
48
49
49
$ . ajax ( ajaxConf ) . done ( function ( res ) {
50
+ if ( res . webPages == null ) return ; // If no result, 'webPages' is 'undefined'
50
51
var paginationAnchors = window . getPaginationAnchors ( Math . ceil ( res . webPages . totalEstimatedMatches / 10 ) ) ;
51
52
res . webPages . value . map ( ob => { results += window . getResultMarkupString ( ob ) ; } )
52
53
You can’t perform that action at this time.
0 commit comments