google search won't open in new page - html

I expect the following code to open the results of a google search in new window but it doesn't. Does anyone have any suggestions?
<body>
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('001782268784890582031:k30dxi2nexc');
customSearchControl.setResultSetSize(google.search.Search.SMALL_RESULTSET);
customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
customSearchControl.draw('cse');
}, true);
</script>
<!--<link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />-->
</body>

No, you misunderstood the meaning of google.search.Search.LINK_TARGET_BLANK
this code should produce following search results: links with target=_blank.
Search results though will show up in the same window.
for reference - please see:
http://code.google.com/apis/websearch/docs/reference.html

Related

Rendering a new fullcalendar instance when ever the calendar function is called using angularjs

I am using fullcalendar plugin and when i click a button it's passing event values to the calendar and calendar is displayed correctly. But when ever I click the button always a new calendar is displayed. I want to display only one calendar and it should display the passed event values accrodingly. please find the below code. Please note that I am not using any jquery libraries
<html>
<head>
<link rel="stylesheet" href="../fullcalendar-4.1.0/packages/core/main.css"></script>
<link rel="stylesheet" href="../fullcalendar-4.1.0/packages/daygrid/main.css"></script>
<link rel="stylesheet" href="../fullcalendar-4.1.0/packages/list/main.css"></script>
<link rel="stylesheet" href="../fullcalendar-4.1.0/packages/timegrid/main.css"></script>
<script type="text/javascript" src="../fullcalendar-4.1.0/packages/core/main.js"></script>
<script type="text/javascript" src="../fullcalendar-4.1.0/packages/daygrid/main.js"></script>
<script type="text/javascript" src="../fullcalendar-4.1.0/packages/timegrid/main.js"></script>
<script type="text/javascript" src="../fullcalendar-4.1.0/packages/list/main.js"></script>
</head>
<script>
$scope.calendarEl = "";
$scope.calendar = "";
$scope.event = {events: [{
title:'test1',
start: '2019-05-05 08:00',
end: '2019-05-10 08:00'
},
{
title:'test2',
start: '2019-05-05 12:00'
}]};
$scope.calendarEl = document.getElementById('calendar');
$scope.calendar = new FullCalendar.Calendar($scope.calendarEl, {
events: $scope.event.events,
plugins: [ 'dayGrid','timeGrid','list' ]
});
$scope.calendar.render();
});
</script>
<body ng-app="myApp" ng-controller="myController">
<div id="calendar" ng-model="eventSources"></div>
</body>
</html>
This can be achieved by using $scope.calendar.addEventSource('name_of_the_array_ofEvent_values')

HTML - browser error --> Can't find variable: Firebase

#jdv the error in the attached screenshot is being displayed in my browser's debugger
NOTE: Firebase DOES initializes in my command line - but my text editor will NOT accept the INITIALIZATION CODE (see code below). I love being challenged, but after 2 1/2 days of not finding a fix, I need help!
For some strange reason, config (in bold text below) is highlighted yellow in my text editor (I'm using brackets).
Here is some of my code:
<script src="/__/firebasejs/4.9.1/firebase-app.js"></script>
<script src="/__/firebasejs/4.9.1/firebase-auth.js"></script>
<script src="/__/firebasejs/4.9.1/firebase-database.js"></script>
<script src="/__/firebasejs/4.9.1/firebase-messaging.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My App Title</title>
<script src="/__/firebasejs/4.9.1/firebase.js"></script>
<script>
// Initialize Firebase
var **config** = {
apiKey: "myapi",
authDomain: "myappname.firebaseapp.com",
databaseURL: "https://myappname.firebaseio.com",
projectId: "myprojectid",
storageBucket: "myappname.appspot.com",
messagingSenderId: "mysenderid",
};
firebase.initializeApp(config);
</script>
Perhaps someone can tell me what I am doing wrong. I am brand new to coding, so I beg your pardon if this is an easy fix :) -lion
Still searching for a solution....
Here is a screenshot of my code:
Thanks for all the helpful suggestions :) -lion
You should use
<script src="https://www.gstatic.com/firebasejs/4.9.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.9.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.9.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.9.0/firebase-messaging.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.9.1/firebase.js"></script>
Instead of:
<script src="/__/firebasejs/4.9.1/firebase-app.js"></script>
<script src="/__/firebasejs/4.9.1/firebase-auth.js"></script>
<script src="/__/firebasejs/4.9.1/firebase-database.js"></script>
<script src="/__/firebasejs/4.9.1/firebase-messaging.js"></script>
<script src="/__/firebasejs/4.9.1/firebase.js"></script>

Google + hangout button

I am trying to add a google hangout button to my html file as shown below but when I run the html page , the button does not show.
<!DOCTYPE html>
<html>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<div id="placeholder-rr"></div>
<script>
gapi.hangout.render('placeholder-rr', {
'render': 'createhangout',
'initial_apps': [{'app_id' : '184219133185', 'start_data' : 'dQw4w9WgXcQ', 'app_type' : 'ROOM_APP' }],
'widget_size': 175
});
</script>
</html>
First please check if any errors showing up in browser console using f12 key when on browser and reload the page.
Try adding this script as well alongwith platform.js to the page you want the hangout button.
<script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script>
Hope this helps
Example code:-
<div id="hangout-button-holder"></div>
<script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script>
$(document).ready(function(){
gapi.hangout.render('hangout-button-holder', { 'render': 'createhangout', 'topic': 'Its a demo app dont freak out', 'hangout_type': 'onair', 'initial_apps': [{'app_id' : 'xxxxxxxxxxx', 'start_data' : 'dQw4w9WgXcQ', 'app_type' : 'LOCAL_APP' }],
'widget_size': 175 });
});
</script>

SAP UI5: object expected error in IE

i am using SAP UI5 and don't know why is it showing object expected in line 347 while running index.html file in ie.
<html>
<head>
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<script src="resources/sap-ui-core.js"
type="text/javascript"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons,sap.ui.ux3"
data-sap-ui-theme="sap_goldreflection" >
</script>
<script type="text/javascript" src="OPM_CM.js"></script>
<script>
sap.ui.localResources("opm");
var view = sap.ui.view({id:"OPM_CM1", viewName:"opm.OPM_CM", type:sap.ui.core.mvc.ViewType.JS});
//view.placeAt("content");
buildShell();
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
thanks in advance.
This may be happening because the sap object is not available.
<script>
function init(){
sap.ui.localResources("opm");
var view = sap.ui.view({id:"OPM_CM1", viewName:"opm.OPM_CM", type:sap.ui.core.mvc.ViewType.JS});
//view.placeAt("content");
buildShell();
}
window.addEventListener('load',init);
</script>
adding your code to a function and calling it on body onload may do the trick.
Note: please also give more details about the error you are getting.

MooTools: Fx.slide couldn't get it worked

i am pretty new to mootools, i found it faster/smoother for animations than jquery so i decided to give it a try.
I don't get why the following code is not working, it is working on jsfiddle with Mootools core and Mootools more 1.3.1
<html>
<head>
<script src="mootools-more-1.3.1.1.js" type="text/javascript"></script>
<script src="mootools-core-1.3.1-full-compat.js" type="text/javascript"></script>
<script type="text/javascript">
window.addEvent('domready', function() {
var myVerticalSlide = new Fx.Slide('paragraph', {mode:'horizontal'}) ;
$('v_slideout').addEvent('click', function(event){
event.stop();
myVerticalSlide.toggle();
});
});
</script>
</head>
<body>
<div id="paragraph">This is a paragraph.</div>
<a id="v_slideout" href="#">Test</a>
</body>
</html>
Can't seem to figure it out, i only could get it worked on jsfiddle.
Any suggestion is appreciated.
Edit: http://jsfiddle.net/F54s3/ << It doesn't work as it should in FF but still it does something, on Opera it seems fine though.
I might have messed up the code as i am pretty new to it, but i am trying to figure out why it works on jsfiddle and doesn't work on my index.html.
The order of your script includes looks suspicious to me:
<script src="mootools-more-1.3.1.1.js" type="text/javascript"></script>
<script src="mootools-core-1.3.1-full-compat.js" type="text/javascript"></script>
Shouldn't the mootools-core file come first?
For example:
http://jsfiddle.net/AxJq9/ (throws Javascript error)
<script src="http://mootools.net/assets/scripts/mootools.more.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.1/mootools.js" type="text/javascript"></script>
http://jsfiddle.net/AxJq9/1/ (doesn't throw an error)
<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.1/mootools.js" type="text/javascript"></script>
<script src="http://mootools.net/assets/scripts/mootools.more.js" type="text/javascript"></script>