OAuth popup redirects to localhost and closes instantly - Phonegap - phonegap-plugins

I am trying to integrate twitter with my PhoneGap app, but for some reason my oauth pop up seems to appear for a second with the correct link to twitter, but then change to localhost and just close down.
I have included <access origin="api.twitter.com" /> in my config file and have also tried <access origin="*" /> but have had no luck.
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../plugins/com.oauthio.plugins.oauthio/www/oauth.js"></script>
<script type="text/javascript" charset="utf-8" src="../plugins/org.apache.cordova.inappbrowser/www/inappbrowser.js"></script>
<script type="text/javascript" charset="utf-8">
function twitterLogin(){
OAuth.initialize('nFIvCI_XGWCKRKtRjmIkWBcGbRo');
OAuth.popup('twitter', {cache: true}).done(function(result) {
result.post('/1.1/statuses/update.json', {
data: {
status: "hello world!"
}
})
}).fail(function(err) {
alert("fail");
})
}
</script>
</head>
<body>
<button onclick="twitterLogin()">twitter</button>

Have you tried adding
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
</feature>
to your config.xml file?
See http://docs.phonegap.com/en/edge/cordova_inappbrowser_inappbrowser.md.html

Related

JSF app with the error: Uncaught ReferenceError: RichFaces is not defined

An application is migrated and now there is an issue when een page is opened and in the console I see the error: "Uncaught ReferenceError: RichFaces is not defined"
It's a Java application on a Weblogic server.
JSF is old, but the application is new to me, I haven't build the application.
This is a part of the code:
<?xml version="1.0" encoding="UTF-8"?>
<f:view
contentType="text/html"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:win="http://winter.ba.uwv.nl/winter"
>
<html>
<h:head>
...
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<h:outputScript name="/javascript/jquery.timers.js" target="head" />
<h:outputScript name="/javascript/preloadCssImages.jQuery_v5.js" target="head" />
<h:outputScript name="/javascript/tooltip.js" target="head" />
<rich:jQuery />
<ui:remove><!-- Disable the a4j:loadStyle tags and enable the link tag to use plain setup --> </ui:remove>
<ui:insert name="head"/>
<h:outputScript target="head">
jQuery(document).ready(function() {
jQuery.preloadCssImages();
...
});
</h:outputScript>
</h:head>
<h:body>
...
The line <rich:jQuery /> is resulting in:
<span id="j_idt7" style="display: none;">
<script type="text/javascript">RichFaces.ui.jQueryComponent.query();</script>
</span>
And the line RichFaces.ui.jQueryComponent.query(); is resulting in the error:
Uncaught ReferenceError: RichFaces is not defined
at home.xhtml:13:152
(anonymous) # home.xhtml:13
I don't understand why a <span...> tag is added in the head?
It seems to me, but I'm not sure an artifact is missing. I have tried to add the following artifacts to my pom.xml file:
richfaces
richfaces-components-ui
richfaces-ui
richfaces-components-ui
richfaces-ui-core-ui
Has someone an idea how to solve "Uncaught ReferenceError: RichFaces is not defined" error?
---- UPDATE (after the Answer of Makhiel) ----
If we do not add the line rich:JQuery and the page is opnening than an jquery spinner is started, which never ends. It 'hangs' with this error:
Uncaught TypeError: jQuery.preloadCssImages is not a function
at HTMLDocument. (userList.xhtml:17:28)
at l (jquery-1.8.3.min.js:2:16996)
at Object.fireWith [as resolveWith] (jquery-1.8.3.min.js:2:17783)
at Function.ready (jquery-1.8.3.min.js:2:12504)
at HTMLDocument.A (jquery-1.8.3.min.js:2:9909)
This is the output in the browser and at line 13 there is the line which is mentioned by #Makhiel. Right after that line, is the line which gives the error: RichFaces.ui.jQueryComponent.query();.
<html>
<head id="j_idt2">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>
/* Fix image caching problem */
try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}
</script>
<title>Winter</title>
<link rel="icon" href="/winter/favicon.ico" type="image/x-icon" />
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<!-- This is the line of Makhiel mentioned, so it exists -->
<script type="text/javascript" src="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.5.17.Final/PackedCompressed/packed/packed.js"></script>
<span id="j_idt9" style="display: none;">
<script type="text/javascript">RichFaces.ui.jQueryComponent.query();</script>
</span>
...
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-base-component.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.component.js">
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery.preloadCssImages();
//perhaps add delay
...
});
</script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-queue.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/status.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/toolbar.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-event.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/togglePanel.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/togglePanelItem.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/collapsiblePanel.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/collapsiblePanelItem.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/message.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.position.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-utils.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-selection.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/AutocompleteBase.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/Autocomplete.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popupPanel.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popupPanelBorders.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popupPanelSizer.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/component-control.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popup.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menuKeyNavigation.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menu-base.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menu.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menugroup.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menuitem.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/contextmenu.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/tooltip.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/datatable.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.mousewheel.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/extendedDataTable.js"></script>
<script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/datascroller.js"></script>
...
</head>
<body>
...
rich:jQuery without any attributes doesn't do anything, so you might as well delete it.
You shouldn't need to add anything in your POM, if JSF didn't know what the richfaces tag was it wouldn't be translating it.
Your generated <head> should contain RichFaces JS sources, something like:
<script type="text/javascript" src="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.5.17.Final/PackedCompressed/packed/packed.js"></script>
This is where the RichFaces object is defined, if it's not on your page (and it sounds like it isn't) you might have a filter in place that blocks it.

Refuse to execute inline script because violates Content Security Policy (primefaces 8)

Enviroment:
Java 11
Jboss 7.2
Primefaces 8
JSF 2.3
I am trying to update a combobox with an ajax render event and the web does not update the combobox and I get this error.
How could I solve this?
ERROR js console
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-ZGRkM2ZjYTAtNzE3MC00MmU4LWE4YmMtOWNmYjUyNjYyMTNh'". Either the 'unsafe-inline' keyword, a hash ('sha256-PoJBY0XvVwb+v60hF7CQr9zfBAfr3HAsK3P9TEKUqGs='), or a nonce ('nonce-...') is required to enable inline execution.
runScript # jsf.js.xhtml?ln=javax.faces:1
runScripts # jsf.js.xhtml?ln=javax.faces:1
doUpdate # jsf.js.xhtml?ln=javax.faces:1
response # jsf.js.xhtml?ln=javax.faces:1
onComplete # jsf.js.xhtml?ln=javax.faces:1
AjaxEngine.req.xmlReq.onreadystatechange # jsf.js.xhtml?ln=javax.faces:1
web.xml
...
<!--Primefaces Content Security Policy-->
<context-param>
<param-name>primefaces.CSP</param-name>
<param-value>true</param-value>
</context-param>
...
face.xhtml
...
<p:selectOneMenu id="cbxOrganisme" value="#{userBean.selected.organism}"
valueChangeListener="#{userBean.onChangeOrganism}"
converter="vTableConverter" filter="true"
rendered="true" required="true" style="width: 90%;">
<f:ajax event="change" execute="#this" listener="#{userBean.onChangeOrganism}" render="cbxCenter"/>
<f:selectItem itemLabel="#{messages['seleccionar']}" itemValue="" noSelectionOption="true"/>
<f:selectItems value="#{userBean.organisms}" var="organism"
itemLabel="#{sessionBean.localeCode eq 'ca'? organism.nomCA:organism.nomES}"
itemValue="#{organism}"/>
</p:selectOneMenu>
...
web.html
<html><head id="j_idt2">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<title>Govern de les Illes Balears - APP
</title><link type="text/css" rel="stylesheet" href="/APP2/javax.faces.resource/theme.css.xhtml?ln=primefaces-bootstrap">
<link type="text/css" rel="stylesheet" href="/APP2/javax.faces.resource/fa/font-awesome.css.xhtml?ln=primefaces&v=8.0">
<link type="text/css" rel="stylesheet" href="/APP2/javax.faces.resource/govern-ie.css.xhtml?ln=css">
<link type="text/css" rel="stylesheet" href="/APP2/javax.faces.resource/buttons.css.xhtml?ln=css">
<link type="text/css" rel="stylesheet" href="/APP2/javax.faces.resource/components.css.xhtml?ln=primefaces&v=8.0">
<script type="text/javascript" src="/APP2/javax.faces.resource/jquery/jquery.js.xhtml?ln=primefaces&v=8.0" nonce="">
</script><script type="text/javascript" src="/APP2/javax.faces.resource/jquery/jquery-plugins.js.xhtml?ln=primefaces&v=8.0" nonce="">
</script><script type="text/javascript" src="/APP2/javax.faces.resource/core.js.xhtml?ln=primefaces&v=8.0" nonce=""></script>
<script type="text/javascript" src="/APP2/javax.faces.resource/components.js.xhtml?ln=primefaces&v=8.0" nonce=""></script>
<script type="text/javascript" src="/APP2/javax.faces.resource/idlemonitor/idlemonitor.js.xhtml?ln=primefaces&v=8.0" nonce=""></script>
<script type="text/javascript" src="/APP2/javax.faces.resource/touch/touchswipe.js.xhtml?ln=primefaces&v=8.0" nonce=""></script>
<link type="text/css" rel="stylesheet" href="/APP2/javax.faces.resource/fileupload/fileupload.css.xhtml?ln=primefaces&v=8.0">
<script type="text/javascript" src="/APP2/javax.faces.resource/fileupload/fileupload.js.xhtml?ln=primefaces&v=8.0" nonce=""></script>
<script type="text/javascript" src="/APP2/javax.faces.resource/jsf.js.xhtml?ln=javax.faces" nonce=""></script>
<script type="text/javascript" nonce="">if(window.PrimeFaces){PrimeFaces.settings.locale='ca';}</script><script type="text/javascript" nonce="">$(function(){PrimeFaces.csp.init('ZTFhYjQ3MDItYzM5Yy00MGU5LWE2NDEtZDFjMTExNDEzMWU4');;});</script>
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-133688930-1" nonce=""></script>
<script nonce="">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-133688930-1');
function redirectPrincipal() {
let context = "APP/";
let mainPage = "principal.xhtml";
let url = window.location.href;
if (url.endsWith(context)) {
window.location.replace(url + "principal.xhtml");
}
}
redirectPrincipal();
</script>
<link rel="SHORTCUT ICON" href="http://www.name.es/webname/favicon.ico"><script type="text/javascript" src="/APP2/javax.faces.resource/calendar-localization.js.xhtml?ln=js" nonce=""></script>
<script type="text/javascript" src="/APP2/javax.faces.resource/functions.js.xhtml?ln=js" nonce=""></script>
<meta name="description" content="APP. VersiĆ³: 8.0.0-">
<meta name="author" content="Govern de les Illes Balears"></head>
<body>
...
</body>
</html>
Content Security Policy known limitations
Currently CSP in combination with <f:ajax> cannot be used with all Faces implementations / versions.
MyFaces supports it since 2.3-next (which will be 4.0 in the future), Mojarra doesn't support it in general: https://github.com/eclipse-ee4j/mojarra/issues/4542
As workaround, you can always use <p:ajax> instead.

Angular 2 : while loading page in internet explorer 11 gives error - SCRIPT5009: 'System' is undefined

I have developed single page application using Angular 2, node , express. It is running fine on chrome and firefox. but same is now working on IE 11. Used following code
Giving error to System in script tag. SCRIPT5009: 'System' is undefined
<html class="ng-scope">
<head>
<base href="/"/>
<title>Test application</title>
<!-- 1. Load libraries -->
<script src="libs/angular2/bundles/angular2-polyfills.js"></script>
<script src="libs/systemjs/dist/system.src.js"></script>
<script src="libs/rxjs/bundles/Rx.js"></script>
<script src="libs/angular2/bundles/angular2.dev.js"></script>
<script src="libs/angular2/bundles/router.dev.js"></script>
<script src="libs/angular2/bundles/http.dev.js"></script>
<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- 2. Configure SystemJS -->
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/bootstrap')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
<!-- End wrapper-->
<script src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="js/plugins/jquery-ui/jquery-ui.js"></script>
<script src="js/bootstrap/bootstrap.min.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="js/plugins/pace/pace.min.js"></script>
</body>
</html>
thanks in advance.
Finally I got the solution using following link.
I have added two javascript reference es6-shim.min.js and shims_for_IE.js
<script src="libs/es6-shim/es6-shim.min.js"></script>
<script src="libs/systemjs/dist/system-polyfills.js"></script>
<script src="libs/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
https://github.com/angular/angular/issues/7144
Note : In this reference libs = node_modules
Try adding
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.1/es6-shim.js"></script>
as first script library

Get FormDigest via application page for SharePoint 2013 App

The default.aspx page created when starting a new SharePoint App is not needing my needs since it inherits from the host web master page and I have found it easier to obtain a responsive design with my own index.aspx page that has less complexity. Using this article JSOM in HTML5 Apps, I am attempting to retrieve the FormDigest, but upon code inspection it is not working. Any ideas? Here is my current code:
<!DOCTYPE html>
<%--Declare the Page Language and obtain the SharePoint namespace required for retrieving the FormDigest header--%>
<%# Page language="C#" %>
<%# Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%# Import Namespace="Microsoft.SharePoint" %>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<link href="../Content/bootstrap.min.css" rel="stylesheet" />
<link href="../Content/App.css" rel="stylesheet" />
<script src="../Scripts/jquery-1.9.1.min.js"></script>
<script src="/_layouts/1033/init.js"></script>
<script src="/_layouts/MicrosoftAjax.js"></script>
<script src="/_layouts/sp.core.js"></script>
<script src="/_layouts/15/sp.runtime.js"></script>
<script src="/_layouts/15/sp.js"></script>
<script src="/_layouts/15/SP.RequestExecutor.js"></script>
<script src="/_layouts/15/SP.UI.Controls.js"></script>
<script src="../Scripts/angular.min.js"></script>
<script src="../Scripts/ui-bootstrap-tpls-0.12.0.min.js"></script>
<script src="../Scripts/angular-route.min.js"></script>
<script src="../Scripts/angular-resource.min.js"></script>
<script src="../Scripts/dirPagination.js"></script>
<script src="../Services/services.js"></script>
<script src="../Controllers/controllers.js"></script>
<script src="../App.js"></script>
</head>
<body>
<SharePoint:FormDigest ID="FormDigest1" runat="server"></SharePoint:FormDigest>
<div class="container" data-ng-app="app">
<div id="chrome_ctrl_container"></div>
<div>
<p id="message">
initializing...
</p>
</div>
<div data-ng-view></div>
<hr>
<footer></footer>
</div>
</body>
</html>
I have discovered that I needed a form instance to execute the call. Its working perfectly:
index.aspx
<!DOCTYPE html>
<%--Declare the Page Language and obtain the SharePoint namespace required for retrieving the FormDigest header--%>
<%# Page language="C#" %>
<%# Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%# Import Namespace="Microsoft.SharePoint" %>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<link href="../Content/bootstrap.min.css" rel="stylesheet" />
<link href="../Content/App.css" rel="stylesheet" />
<script src="../Scripts/jquery-1.9.1.min.js"></script>
<script src="/_layouts/1033/init.js"></script>
<script src="/_layouts/MicrosoftAjax.js"></script>
<script src="/_layouts/sp.core.js"></script>
<script src="/_layouts/15/sp.runtime.js"></script>
<script src="/_layouts/15/sp.js"></script>
<script src="/_layouts/15/SP.RequestExecutor.js"></script>
<script src="/_layouts/15/SP.UI.Controls.js"></script>
<script src="../Scripts/angular.min.js"></script>
<script src="../Scripts/ui-bootstrap-tpls-0.12.0.min.js"></script>
<script src="../Scripts/angular-route.min.js"></script>
<script src="../Scripts/angular-resource.min.js"></script>
<script src="../Scripts/dirPagination.js"></script>
<script src="../Services/services.js"></script>
<script src="../Controllers/controllers.js"></script>
<script src="../App.js"></script>
</head>
<body>
<%-- Get the form digest to use for POST/Update/Delete operations via Web services--%>
<form id="Form1" method="post" runat="server">
<SharePoint:FormDigest ID="FormDigest1" runat="server"></SharePoint:FormDigest>
</form>
<div class="container" data-ng-app="app">
<div id="chrome_ctrl_container"></div>
<div>
<p id="message">
initializing...
</p>
</div>
<div data-ng-view></div>
<hr>
<footer></footer>
</div>
</body>
</html>
Example of us in ngResource call via AngularJS:
appServices.factory('appTypes', ['$resource', function ($resource) {
return $resource("/_api/web/lists/getbytitle('Todo Types List')/Items", {Id: "#Id"},
{
'query': { method: "GET", isArray: false, headers: { 'Accept': 'application/json;odata=nometadata' } },
'update': { method: 'PATCH', headers: { 'Accept': 'application/json;odata=nometadata' } },
'save': { method: 'POST', headers: { 'Accept': 'application/json;odata=nometadata', 'content-type': 'application/json;odata=nometadata', 'X-RequestDigest': $("#__REQUESTDIGEST").val() } }
}
);
}]);

Object doesn't support property or method 'autocomplete'

I am getting the above mentioned error. Below is my code snippet.
<link rel="stylesheet" href="/css/autoComplete/jquery-ui.css" />
<link rel="stylesheet" href="/css/core.css">
<link rel="stylesheet" href="css/theme.css">
<link rel="stylesheet" href="/css/datepicker.css">
<link rel="stylesheet" href="/css/customlook.css">
<link rel='stylesheet' href='/css/Header.css' />
<link rel='stylesheet' href='/css/Test.css' />
<script type="text/javascript" src="/js/autoComplete/jquery.min.js"></script>
<script type="text/javascript" src="/js/autoComplete/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/advanced_search_filters.js"></script>
<script type="text/javascript" src="/js/dateJs/jquery.js"></script>
<script type="text/javascript" src="/js/dateJs/core.js"></script>
<script type="text/javascript" src="/js/dateJs/datepicker.js"></script>
<script type="text/javascript" src="/js/user.js"></script>
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript">
$(document).ready(function() {
alert('testing');
$("#CARD_HOLDER_NAME").autocomplete({
source : '${pageContext. request. contextPath}/cardHolderName'
});
});
</script>
Please help me to resolve it.
You're missing/wrongly placed jQuery/ jQuery UI.js/ autocomplete.js files and the order should be
(1) jQuery.js
(2) jQuery UI.js
(3) autocomplete.js
Add the following before autocomplete
<script src="http://code.jquery.com/jquery-1.9.1.js />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" />

Resources