Search Results

Search found 23820 results on 953 pages for 'jquery ui autocomplete'.

Page 170/953 | < Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >

  • AJAX Submit to PHP still loading page after preventDefault()

    - by dannyburrows
    I have a webpage that I am using .ajax to send variables to a php script. The php page is loading into the browser as if I was navigating to it. The script is loading the data correctly, so my issue is stopping the navigation and keeping the user on the original page. The code for my form is here: echo "<form method='post' action='addTask.php' id='myform'>\n"; echo "<input name='addtask' id='addtask' maxlength='64'/><br/>\n"; echo "<input type='submit' name='submit' id='submit' value='Add Task'/>\n"; echo "</form>\n"; The code for my jquery is here: $(function(){ $('#myform').submit(function(e){ e.stopPropagation(); $.ajax({ url: 'addTask.php', type: 'POST', data: {}, success: alert("Success") }); }); }); I have tried: e.preventDefault(), e.stopPropagation() and return false. Any help is appreciated. $("#submit").click(function(e){ e.preventDefault(); $.ajax({ type: "POST", url: "addtask.php", data: { } }) .done(function() { alert( "success" ); }) .fail(function() { alert( "error" ); }); and $(function(){ $('#myform').submit(function(e){ e.preventDefault(); $.ajax({ url: 'addTask.php', type: 'POST', data: {}, success: function(){alert("Success")} }); }); });

    Read the article

  • Loading Facebook fb:profile-pic via AJAX in Facebook Connect site

    - by mbrevoort
    After a page loads, I'm making an AJAX request to pull down an HTML chunk that contains tags representing a Facebook user profile picture. I append the result to a point in the DOM but the logos don't load, instead all I see is the default silhouette. Here's simply how I'm loading the HTML chunk with jQuery $.ajax({ url: "/facebookprofiles" success: function(result) { $('#profiles').append(result); } }); The HTML that I'm appending is a list of diffs like this: <div class="status Accepted"> <fb:profile-pic class="image" facebook-logo="true" linked="true" size="square" uid="1796055648"></fb:profile-pic> <p> <strong>Corona Kingsly</strong>My Status Update<br/> <span style="font-size: 0.8em">52 minutes ago</span> </p> </div> Any ideas? I assume the fb tags are not being processed once the dom is loaded. Is there any way to make that happen? I'm not seeing any exceptions or errors in my Firebug console. Thanks

    Read the article

  • comparing strings from two different sources in javascript

    - by andy-score
    This is a bit of a specific request unfortunately. I have a CMS that allows a user to input text into a tinymce editor for various posts they have made. The editor is loaded via ajax to allow multiple posts to be edited from one page. I want to be able to check if there were edits made to the main text if cancel is clicked. Currently I get the value of the text from the database during the ajax call, json_encode it, then store it in a javascript variable during the callback, to be checked against later. When cancel is clicked the current value of the hidden textarea (used by tinymce to store the data for submission) is grabbed using jquery.val() and checked against the stored value from the previous ajax call like this: if(stored_value!=textarea.val()) { return true } It currently always returns true, even if no changes have been made. The issue seems to be that the textarea.val() uses html entities, whereas the ajax jsoned version doesn't. the response from ajax in firebug looks like this: <p>some text<\/p>\r\n<p>some more text<\/p> the textarea source code looks like this: &lt;p&gt;some text&lt;/p&gt; &lt;p&gt;some more text&lt;/p&gt; these are obviously different, but how can I get them to be treated as the same when evaluated? Is there a function that compares the final output of a string or a way to convert one string to the other using javascript? I tried using html entities in the ajax page, but this returned the string with html entities intact when alerted, I assume because json_encoding it turned them into characters. Any help would be greatly appreciated.

    Read the article

  • jqueryvalidation no space customization

    - by Ken
    i have a form where the user can update his name and last name. i use jquery validation to validate the form. how can i validate if the user put spaces? here's what i have: <script> $(document).ready(function(){ $('#submit').click(function() { var valid = $("#myform").valid(); if(!valid) { return false; } $.ajax({ type: "POST", url: 'save', data: $('#myform').serialize(), dataType: 'json', cache: false, success: function(result) { // redirect to another page } }); }); }); </script> </head> <body> <form id="myform" method="post" action=""> <fieldset> <legend>update name</legend> <p> <label for="fname">Name</label> <em>*</em><input id="fname" name="fname" size="25" class="required" minlength="2" /> </p> <p> <label for="lname">Last Name</label> <em>*</em><input id="lname" name="lname" size="25" class="required" minlength="2" /> </p> <p> <input id="submit" type="submit" value="Submit"/> </p> </fieldset> </form> thanks

    Read the article

  • Modify jkpanel to load internal content instead of external content

    - by Adam Stone
    I am using an implementation of jkpanel in a vb.net app, the script (see below) loads an external file into the drop down panel. I need to modify this script to load an internal content like a specific div or span so that I can have this nested within the master page. //Drop Down Panel script (March 29th, 08'): By JavaScript Kit: http://www.javascriptkit.com var jkpanel={ controltext: 'Panel Content', $mainpanel: null, contentdivheight: 0, openclose:function($, speed){ this.$mainpanel.stop() //stop any animation if (this.$mainpanel.attr('openstate')=='closed') this.$mainpanel.animate({top: 0}, speed).attr({openstate: 'open'}) else this.$mainpanel.animate({top: -this.contentdivheight+'px'}, speed).attr({openstate: 'closed'}) }, init:function(file, height, speed){ jQuery(document).ready(function($){ jkpanel.$mainpanel=$('<div id="dropdownpanel"><div class="contentdiv"></div><div class="control">'+jkpanel.controltext+'</div></div>').prependTo('body') var $contentdiv=jkpanel.$mainpanel.find('.contentdiv') var $controldiv=jkpanel.$mainpanel.find('.control').css({cursor: 'wait'}) $contentdiv.load(file, '', function($){ var heightattr=isNaN(parseInt(height))? 'auto' : parseInt(height)+'px' $contentdiv.css({height: heightattr}) jkpanel.contentdivheight=parseInt($contentdiv.get(0).offsetHeight) jkpanel.$mainpanel.css({top:-jkpanel.contentdivheight+'px', visibility:'visible'}).attr('openstate', 'closed') $controldiv.css({cursor:'hand', cursor:'pointer'}) }) jkpanel.$mainpanel.click(function(){jkpanel.openclose($, speed)}) }) } } //Initialize script: jkpanel.init('path_to_content_file', 'height of content DIV in px', animation_duration) jkpanel.init('panelcontent.htm', '200px', 500) Does anybody have any idea on how to modify this to do so or even have any tips or pointers to point me in the right direction to start doing so. Cheers

    Read the article

  • javascript exceed timeout

    - by user1866265
    I use jquery to develop mobile application, here is my code below the problem that when I add 5 or 6 line to the page contained all goes well. but if I add multiple line displays error message: Javascript execution exeeded timeout. function succes_recu_list_rubrique(tx, results) //apés avoire remplir sqlite { console.log('ENTRééééééééééééééé---') $('#lbtn').prepend("<legend>Selectionner un Rubrique</legend><br>"); for( var i=0; i<results.rows.length; i++ ) //Remplir tableau liste des identifiants étapes { $('#lbtn').append("<input name='opt1' checked type='radio' value="+results.rows.item(i).IdRubrique+" id="+results.rows.item(i).IdRubrique+" />"); $('#lbtn').append('<label for='+results.rows.item(i).IdRubrique+'>'+results.rows.item(i).LibelleRubrique+'</label>'); } $('#lbtn').append('<a href="#page_dialog2" class="offer2" data-rel="dialog" data-role="button" >Consulter</a>').trigger('create'); $('#lbtn').append('<a href="#'+id_grp_rub+'" data-role="button" data-rel="back" data-theme="c" >Cancel</a> ').trigger('create'); }

    Read the article

  • How To Share Information Between Django and Javascript?

    - by Randy
    So I am pretty new to both Django and Javascript (I am using JQuery) and I am wondering if I am doing a hack or if there are more slick ways to send client-side displayed database ids to the django server-side. Here is my process: I have a dataTable (http://datatables.net) that I am displaying rows of data by using the bProcessing option to use AJAX to retrieve records from the database. The URL in my urls.py is something like: url(r'^assets/activitylog/(?P<cid>.*)$', views.getActivityTable_ajax, name="activitylog_table"), and my dataTable ajax-relavant code is something like: "sAjaxSource": "/assets/activitylog/" + getIDFromHTML(), where the javascript function getIDFromHTML() grabs <cid> that is used by the Django view is simply: function getIDFromHTML(){ // Simply return the text in the #release_id div element from the HTML return $("#release_id").html(); }; This is the part that seems "hacky" to me. I am inserting into my template code the database id that I am using in the datatables URL (with display:none in the css) just so I can pass it back to the view. Most of this is necessitated because one cannot use django template tags in the javascript code unless the code is embedded into the HTML itself, which I am not (and will not) do. The only other thing that I have found is to change the URL to get rid of the parameter passed in to: url(r'^assets/activitylog', views.getActivityTable_ajax, name="activitylog_table"), and change the view code to: def getActivityTable_ajax(request): """Returns the activity for a given pid from HTTP GET ajax reqest""" pid = int(urlparse.urlparse(request.META['HTTP_REFERER']).path.split('/')[-1]) # rest of view code here... since the id that I need is on the end of this referer url. This way I don't have to monkey around with embedding the hidden database id into the HTML and passing it back to via ajax the the table population view code. Is it okay to use HTTP_REFERER in the request object in this manner? Am I going about this in the totally wrong way? Thanks in advance!

    Read the article

  • Add/remove validation rules Dynamically

    - by eddy
    Hi, I need to dynamically add validation rules to a text box when the user clicks on the checkbox in that row and remove it when the user unchecks it. This is what I did, and it works fine, but I'm not sure if it is the right way to do it. Here's my html code: <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectItems" value="<c:out value="${item.numberPlate}"/>" /> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}"/></td> <td align="left"><input type="text" name="mileage_<c:out value="${item.numberPlate}"/>" value="" /></td> </tr> </c:forEach> </tbody> and my jquery: $("input[name=selectItems]").change(function() { if (this.checked) { $(this).closest("tr").find("input[name^=mileage]").attr("class","required"); $(this).closest("tr").find("input[name^=mileage]").attr("number",true); } else { $(this).closest("tr").find("input[name^=mileage]").attr("class","") } }); any suggestion is welcome and... I almost forgot, Merry Xmas!

    Read the article

  • Working With Feeds and Lists

    - by Nathan Campos
    I'm using a ListView component to list up some informations at a RSS feed, but when the user clicks the row, I want to change into a detailed view of that RSS Item, so far I've done this: function parseFeed(feed) { var html = ""; for(var i = 0; i < feed.items.length && i < 5; i++) { var item = feed.items[i]; var title = item.title; html += "\n<li onClick='goDetailed()'>\n"; html += "<h3><a href='#' class='ui-link-inherit'>" + title + "</a></h3>\n"; html += "<p>" + item.description + "</p>\n"; html += "</li>"; } $("#dList").append(html); $("#dList").listview('refresh'); } function goDetailed() { $.mobile.changePage($('#detailedPage')); } One of my problems is that the Back button won't come back(it does nothing). My other question is how I can pass the item.title, item.description, item.link and item.updated of the selected row(feed item) to some <div data-role="content">'s at the detail page.

    Read the article

  • $().buttonset not working on dialog modal box JQUERY

    - by vikitor
    Hello everyone! I've done a dialog box that contains a form inside it, and I would like to add some jquery fancy items to it. I've been trying with $().buttonset() as I've done with most of my radio buttons in the application, in order to get a coherent IU for my application. The thing is that, even if following the rules specified, the buttons remain as a normal radio button, and not with the fancy interface. Do you know what could be the problem? This is the part of the form where I want the fancy radio buttons: <div id ="Replace"> <input type="radio" name="Replace" value = "true" id = "ReplaceYes" onclick = "setReplace(this)" /> <label for="ReplaceYes">Yes</label> <input type="radio" name="Replace" value = "false" checked="checked" id = "ReplaceNo" onclick = "setReplace(this)" /> <label for="ReplaceNo">No</label> </div> And then, as the previous part of code is in a partial view, invoked when showing the modal box, this is how I try to convert the buttons appearance: $("#Replace").buttonset(); The thing is that, debugging it I've seen that it goes through that part of the code, but it doesn't do what it's meant to do. Any clue? Thanks everyone for your attention, vikitor

    Read the article

  • How to create a new ID for the new added node?

    - by marknt15
    Hi, I can normally get the ID of the default tree nodes but my problem is onCreate then jsTree will add a new node but it doesn't have an ID. My question is how can I add an ID to the newly created tree node? What I'm thinking to do is adding the ID HTML attribute to the newly created tree node but how? I need to get the ID of all of the nodes because it will serve as a reference for the node's respective div storage. HTML code: <div class="demo" id="demo_1"> <ul> <li id="phtml_1" class="file"><a href="#"><ins>&nbsp;</ins>Root node 1</a></li> <li id="phtml_2" class="file"><a href="#"><ins>&nbsp;</ins>Root node 2</a></li> </ul> </div> JS code: $("#demo_1").tree({ ui : { theme_name : "apple" }, callback : { onrename : function (NODE, TREE_OBJ) { alert(TREE_OBJ.get_text(NODE)); alert($(NODE).attr('id')); } } }); Cheers, Mark

    Read the article

  • Get dragged / saved items state back from Sql Server

    - by user571507
    Ok i saw many post's on how to serialize the value of dragged items to get hash and they tell how to save them. Now the question is how do i persist the dragged items the next time when user log's in using the has value that i got eg: <ul class="list"> <li id="id_1"> <div class="item ui-corner-all ui-widget ui-widget-content"> </div> </li> <li id="id_2"> <div class="item ui-corner-all ui-widget ui-widget-content"> </div> </li> <li id="id_3"> <div class="item ui-corner-all ui-widget ui-widget-content"> </div> </li> <li id="id_4"> <div class="item ui-corner-all ui-widget"> </div> </li> </ul> which on serialize will give "id[]=1&id[]=2&id[]=3&id[]=4" Now think that i saved it to Sql server database in a single field called SortOrder. Now how do i get the items to these order again ? the code to make these sort is below,without which people didn't know which library i had used to sort and serialize <script type="text/javascript"> $(document).ready(function() { $(".list li").css("cursor", "move"); $(".list").sortable(); }); </script>

    Read the article

  • Accessing the calling object into ajax response... (not the ajax call)

    - by Nishchay Sharma
    I have an object of type Application (defined by me). Whenever an object of this type is created, it automatically loads a php file say "start.php" using jquery ajax and assign the response to a div say "Respo". Now what i want is to access the Application object from that Respo div. Unfortunately, i have no clue how to do this... in my ajax call: function Application(options) { ....... var appObj=this; $.ajax({ url:appObj.location, //Already defined success:function(data) { $("#respo").html(data); } }); } Now in my Respo division i want to access that Application object... I tried: alert(this) but it resulted in an object of DOMWindow... i tried editing success function as: function Application(options) { ....... var appObj=this; $.ajax({ url:appObj.location, //Already defined success:function(data) { $("#respo").html("<script type='text/javascript'>var Self="+appObj+"</script>"); $("#respo").html(data); } }); } But i ended nowhere. :( Although if i assign "var Self='nishchay';" then alerting Self from start.php gives nishchay but i am not able to assign the calling object of Application type to the Self variable. It is the only way I cud think of. :\ Please help me... actually my object has some editing functions to control itself - its look and feel and some other options. I want the code loaded by object to control the object itself. Please help me.. Thanks in advance. Nishchay

    Read the article

  • TypeError: Object #<HTMLDocument> has no method 'observe' issue with the plugin chosen

    - by NewBoy
    Hi made attempts to install the Jquery plugin chosen which enables me to customise my <select> tag in all browsers. Click here Anyway i have integrated this pluigin into my site and i have come across the following error message in my element inspector..Click here "TypeError: Object # has no method 'observe'" from the following code <script type="text/javascript"> document.observe('dom:loaded', function(evt) { var select, selects, _i, _len, _results; if (Prototype.Browser.IE && (Prototype.BrowserFeatures['Version'] === 6 || Prototype.BrowserFeatures['Version'] === 7)) { return; } selects = $$(".chzn-select"); _results = []; for (_i = 0, _len = selects.length; _i < _len; _i++) { select = selects[_i]; _results.push(new Chosen(select)); } deselects = $$(".chzn-select-deselect"); for (_i = 0, _len = deselects.length; _i < _len; _i++) { select = deselects[_i]; _results.push(new Chosen(select,{allow_single_deselect:true})); } return _results; }); </script> Does anyone know how i can solve this problem??

    Read the article

  • How do I select only the 4th and higher LIs in each UL?

    - by KatieK
    For this XHTML: <ul class="collapse"> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul> <ul class="collapse"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> Using jQuery, how do I select only the 4th and higher LIs in each UL? I've tried: $("ul.collapse li:gt(2)").css("color", "red"); But it selects the 4th and higher LIs in the whole document. "Four", "Five", and "1", "2", "3", "4" are red.

    Read the article

  • Catch/Intercept all mouse clicks

    - by Hallik
    I have this simple script that catches all mouse clicks, unless you click on something that actually works. Links, flash videos, etc. How can I adjust this so no matter what a user clicks on, before the video loads, new page loads, etc. It sends the simple GET request I built? (function($) { $.fn.saveClicks = function() { $(this).bind('mousedown.clickmap', function(evt) { var clickDocument = (document.documentElement != undefined && document.documentElement.clientHeight != 0) ? document.documentElement : document.body; var width = clickHeatDocument.clientWidth != undefined ? clickDocument.clientWidth : window.innerWidth; var height = clickHeatDocument.clientHeight != undefined ? clickDocument.clientHeight : window.innerHeight; var scrollx = window.pageXOffset == undefined ? clickDocument.scrollLeft : window.pageXOffset; var scrolly = window.pageYOffset == undefined ? clickDocument.scrollTop : window.pageYOffset; var x = evt.clientX + scrollx; var y = evt.clientY + scrolly; $.get('/click-save.php', { "x":evt.pageX, "y":evt.pageY, "click":"true", "w":width, "h":height, "l":escape(document.location.pathname), "d":escape(document.domain) }); }); }; })(jQuery); $(function() { $(document).saveClicks(); });

    Read the article

  • How to load src in html5 Video tag from JavaScript?

    - by luis_laurent
    Here is the thing, I'm working with ASP.NET and I'm using this particular SignalR library to broadcast a video to my clients, but as far as I know I can not stream video because signalR is a messaging system and it is not intended to stream video, files or things like that. Now what I am trying to do is to split the video into buffers that is Base64-encoded into a string, then on the client I am decoding this string and I am trying to load it into the source of a Video tag. Here I show you what I am doing on the client: HTML Code: <video id="myVideo"> <source id="video_source"> </video> Javascript Code: //here somehow I am getting the string with the base64-encoded video function playVideo(message) { var myVideo = document.getElementById("myVideo"); var mySource = document.getElementById("video_source"); mySource.setAttribute("src", getEncodedVideoString("avi", message)); myVideo.load(); myVideo.play(); }; // here I am formatting and concatenating the string for my source attribute function getEncodedVideoString(type, file) { return 'data:video/' + type + ';base64,' + $.base64.decode(file); } Well as you can see, at the moment I'm facing a scenario a little weird, but I already have the video encoded on the client, now I just need to find out the way to reproduce that video. And here is when my question comes up, does any one has done something like this before, or you have any idea or suggestion to do that? P.S I am using this jquery-base64 library to decode my string

    Read the article

  • OBIEE 11.1.1 - User Interface (UI) Performance Is Slow With Internet Explorer 8

    - by Ahmed A
    The OBIEE 11g UI is performance is slow in IE 8 and faster in Firefox.  For VPN or WAN users, it takes long time to display links on Dashboards via IE 8. Cause is IE 8 generates many HTTP 304 return calls and this caused the 11g UI slower when compared to the Mozilla FireFox browser. To resolve this issue, you can implement HTTP compression and caching. This is a best practice.Why use Web Server Compression / Caching for OBIEE? Bandwidth Savings: Enabling HTTP compression can have a dramatic improvement on the latency of responses. By compressing static files and dynamic application responses, it will significantly reduce the remote (high latency) user response time. Improves request/response latency: Caching makes it possible to suppress the payload of the HTTP reply using the 304 status code.  Minimizing round trips over the Web to re-validate cached items can make a huge difference in browser page load times. This screen shot depicts the flow and where the compression and decompression occurs: Solution: a. How to Enable HTTP Caching / Compression in Oracle HTTP Server (OHS) 11.1.1.x 1. To implement HTTP compression / caching, install and configure Oracle HTTP Server (OHS) 11.1.1.x for the bi_serverN Managed Servers (refer to "OBIEE Enterprise Deployment Guide for Oracle Business Intelligence" document for details). 2. On the OHS machine, open the file HTTP Server configuration file (httpd.conf) for editing. This file is located in the OHS installation directory.For example: ORACLE_HOME/Oracle_WT1/instances/instance1/config/OHS/ohs13. In httpd.conf file, verify that the following directives are included and not commented out: LoadModule expires_module "${ORACLE_HOME}/ohs/modules/mod_expires.soLoadModule deflate_module "${ORACLE_HOME}/ohs/modules/mod_deflate.so 4. Add the following lines in httpd.conf file below the directive LoadModule section and restart the OHS: Note: For the Windows platform, you will need to enclose any paths in double quotes ("), for example:Alias "/analytics ORACLE_HOME/bifoundation/web/app"<Directory "ORACLE_HOME/bifoundation/web/app"> Alias /analytics ORACLE_HOME/bifoundation/web/app#Pls replace the ORACLE_HOME with your actual BI ORACLE_HOME path<Directory ORACLE_HOME/bifoundation/web/app>#We don't generate proper cross server ETags so disable themFileETag noneSetOutputFilter DEFLATE# Don't compress imagesSetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary<FilesMatch "\.(gif|jpeg|png|js|x-javascript|javascript|css)$">#Enable future expiry of static filesExpiresActive onExpiresDefault "access plus 1 week"     #1 week, this will stops the HTTP304 calls i.e. generated by IE 8Header set Cache-Control "max-age=604800"</FilesMatch>DirectoryIndex default.jsp</Directory>#Restrict access to WEB-INF<Location /analytics/WEB-INF>Order Allow,DenyDeny from all</Location> Note: Make sure you replace above placeholder "ORACLE_HOME" to your correct path for BI ORACLE_HOME.For example: my BI Oracle Home path is /Oracle/BIEE11g/Oracle_BI1/bifoundation/web/app Important Notes: Above caching rules restricted to static files found inside the /analytics directory(/web/app). This approach is safer instead of setting static file caching globally. In some customer environments you may not get 100% performance gains in IE 8.0 browser. So in that case you need to extend caching rules to other directories with static files content. If OHS is installed on separate dedicated machine, make sure static files in your BI ORACLE_HOME (../Oracle_BI1/bifoundation/web/app) is accessible to the OHS instance. The following screen shot summarizes the before and after results and improvements after enabling compression and caching:

    Read the article

  • Customizing Spaces UI

    - by vijaykumar.yenne
    In most common scenarios we stumble up on use cases to customize the Web center spaces UI. Is the Spaces UI customizable? What is the extent to which we can customize? How do i customize it? These are some questions that developers/architects normally come across. Well to clear the air, OOTB spaces comes with some default "site templates" and it also gives a flexibility to create custom site templates suiting the organization needs. The site templates concept has been introduced in the latest PS1 release of webcenter and to customize/create the the new site template, we have to leverage the Extend Spaces Project available on OTN. You could download the the project from here. Also there is white paper available on what all can be customized/extended from spaces perspective listed here . There is a specific details outlined on how to create custom site template in the Customizing Site Template white paper. One of the things the white paper high lights is "While you can create new site templates and modify the sample site templates but you cannot modify either of the out-of-the-box site templates ie the default and maximized. So if my need is to either increase the size of header to fit in a bigger logo or introduce couple of extra links on the default/maximized lay out how do i achieve this? All you need to do is customize the OOTB shell (shell-config.xml). 1. Copy the shell config's available in the Source Files Directory of the extended spaces unzipped directory into the CustomSite Template Project ExtendWebCenterSpaces\CustomSiteTemplate\custom\oracle\webcenter\webcenterapp\metadata\shell 2. Modify the appropriate shell 3. Deploy the CustomSite Template as ADF Jar 4. ensure you have the profile dependency on the aboproject int he custom webcenter spaces project 5. Deploy the Spaces Extension on the Webcenter Spaces Instance. (Details in the first white paper). You should see the changes immediately. eg: In the default shell, i have changed the height from 30 to 60 to increase the header size height="60" This is what i get to see : If you have worked on the R1 release time frame, where you created a custom shell/chrome, how do we make them compatible and make it available in the Spaces PS1 instance? All you need to do is the following: 1. Copy the custom shell in to the shell directory of the custom site template project 2. Register the shell with WCSiteTemplates.xml available in the same project. Eg : Yo can add the below entry pagePath="/oracle/webcenter/webcenterapp/view/templates/MyShellTemplate.jspx" pageDefPath="/oracle/webcenter/webcenterapp/bindings/pageDefs/oracle_webcenter_webcenterapp_view_templates_WebCenterAppShellTemplatePageDef.xml" displayName="myShell" chromeLevel="myShell"/ Note : pagePath - Absolute path of the template JSPX file. This path must be unique. So you might have to do the following to get your custom chrome working absolutely fine with no problems at all: 1. Create a jspx page, say /custom/mysite/SiteTemplate.jspx 2. Include the the default jspx in the new site template like following SiteTemplate.jspx ------------------ 3. Add the newly created site template in the WCSiteTemplate.xml file like following - pagePath="/custom/mysite/SiteTemplate.jspx" pageDefPath="/oracle/webcenter/webcenterapp/bindings/pageDefs/oracle_webcenter_webcenterapp_view_templates_WebCenterAppShellTemplatePageDef.xml" displayName="myShell" chromeLevel="myShell"/

    Read the article

  • Contact Form + jQuery validationengine

    - by BigMad
    I created this contact form, inserting jQuery fadeLabel and validationEngine to beautify the form the file index.php / .html (I have not yet figured out which of the two versions put it) scripts are index: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script src="/js/backtop.js"></script> <script src="/js/fadeLabel.js"></script> <script> $(document).ready(function () { $('form .fadeLabel').fadeLabel(); }); </script> <script src="/js/validationEngine-it.js"></script> <script src="/js/validationEngine.js"></script> <script> $(document).ready(function(){ $("#form_box").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: "contact.php", ajaxSubmitMessage: "Thank you, We will contact you soon !", success : false, failure : function() {} }) }); </script> <script src="/js/contactform.js"></script> however this is the part of the form's code <p id="form_success" class="success hide"><strong>Grazie!</strong> Il tuo messaggio è stato inviato con successo.</p> <form id="form_box"> <fieldset> <p><label for="name">Nome*</label><input type="text" id="name" name="name" class="validate[required] fadeLabel" value=""/></p> <p><label for="email">E-mail*</label><input type="email" id="email" name="email" class="validate[required,custom[email]] fadeLabel" value=""/></p> <p><label for="website">Sito web</label><input type="url" id="website" name="website" class="fadeLabel" value=""/></p> <p><label for="message">Messaggio*</label><textarea id="message" name="message" class="validate[required] fadeLabel" cols="30" rows="10" value=""></textarea></p> </fieldset> <p id="form_submit" class="submit"><button class="send">Invia</button> *Campi obbligatori</p> <p id="form_send" class="send hide">Invio in corso&hellip;</p> <p id="form_error" class="submit error hide"><button class="send">Invia</button> Si prega di correggere l'errore e re-inviarlo.</p> </form> This is the contact.php where it receives the data and sends 2 emails (one for me with the data and a thank you to those who contacted me) contact.php: <?php //include variables $my_email = "[email protected]"; $my_site = "adrianogenovese.com"; session_start(); $name = $_POST['name']; $email = $_POST['email']; $website = $_POST['website']; $message = $_POST['message']; $ip = $_SERVER['REMOTE_ADDR']; //beginning to email me $to = $my_email; $sbj = "Richiesta Informazioni - $my_site"; $msg = " <html> ... //the body of the email to me ... </html> "; $from = $email; $headers = 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n"; $headers .= "From: $from"; mail($to,$sbj,$msg,$headers); //email sent to me //beginning of the email recipient $toClient = $email; $msgClient = " <html> ... //the body of the email recipient ... </html> "; $fromClient = $my_email; $sbjClient = "Grazie $name per aver contattato $my_site "; $headersClient = 'MIME-Version: 1.0' . "\r\n"; $headersClient .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headersClient .= "From: $fromClient"; mail($toClient,$sbjClient,$msgClient,$headersClient); //mail inviata al cliente //order confirmation email //Reset error session_destroy(); exit; ?> this is the contact form jscript contactform.js: $(document).ready(function() { $(".send").click(function(){ $("#form_send").removeClass('hide'); $("#form_submit").addClass('hide'); $("#form_error").addClass('hide'); var name = $("#name").val(); var email = $("#email").val(); var website = $("#website").val(); var message = $("#message").val(); if (name == "" || email == "" ) { $("#form_send").addClass('hide'); $("#form_error").removeClass('hide'); } else { $.ajax({ type: "POST", url: "contatti/contact.php", data: "name=" + name + "&email=" + email + "&message=" + message + "&website=" + website, dataType: "html", success: function(msg) { $("#form_send").addClass('hide').delay(3000).fadeOut(3000); $("#form_success").removeClass('hide'); $("#form_box").addClass('hide').slideUp(2000).fadeOut(); }, error: function() { alert("An unexpected error occurred..."); } }); } }); //end form });//end Dom The jQuery seem to work very well, I wanted to make sure that the page is not of the form updated or go to another page (the only thing that works for now) compensation reflected in the following problems: I always leave the alert of contactform.js Does not send any mail, it to me to recipient I can not do the work properly. delay () .fadeOut / fadeIn and. SlideUp (). FadeOut () so that the sending of this email appears for 3 seconds "$ (" # form_send "). addClass ('hide')" before you do anything else then the form disappears up using some second type slideUp "$ (" # form_box "). addClass ('hide')" by displaying just the "$ (" # form_success "). removeClass ('hide')" in the address bar also appears the form data (e.g. ../index.php?name=test&email=example%40mail.com&website=&message=helloworld)

    Read the article

  • jQuery DataTables server side processing and ASP.Net

    - by Chad
    I'm trying to use the server side functionality of the jQuery Datatables plugin with ASP.Net. The ajax request is returning valid JSON, but nothing is showing up in the table. I originally had problems with the data I was sending in the ajax request. I was getting a "Invalid JSON primative" error. I discovered that the data needs to be in a string instead of JSON serialized, as described in this post: http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/. I wasn't quite sure how to fix that, so I tried adding this in the ajax request: "data": "{'sEcho': '" + aoData.sEcho + "'}" If the aboves eventually works I'll add the other parameters later. Right now I'm just trying to get something to show up in my table. The returning JSON looks ok and validates, but the sEcho in the post is undefined, and I think thats why no data is being loaded into the table. So, what am I doing wrong? Am I even on the right track or am I being stupid? Does anyone ran into this before or have any suggestions? Here's my jQuery: $(document).ready(function() { $("#grid").dataTable({ "bJQueryUI": true, "sPaginationType": "full_numbers", "bServerSide":true, "sAjaxSource": "GridTest.asmx/ServerSideTest", "fnServerData": function(sSource, aoData, fnCallback) { $.ajax({ "type": "POST", "dataType": 'json', "contentType": "application/json; charset=utf-8", "url": sSource, "data": "{'sEcho': '" + aoData.sEcho + "'}", "success": fnCallback }); } }); }); HTML: <table id="grid"> <thead> <tr> <th>Last Name</th> <th>First Name</th> <th>UserID</th> </tr> </thead> <tbody> <tr> <td colspan="5" class="dataTables_empty">Loading data from server</td> </tr> </tbody> </table> Webmethod: <WebMethod()> _ Public Function ServerSideTest() As Data Dim list As New List(Of String) list.Add("testing") list.Add("chad") list.Add("testing") Dim container As New List(Of List(Of String)) container.Add(list) list = New List(Of String) list.Add("testing2") list.Add("chad") list.Add("testing") container.Add(list) HttpContext.Current.Response.ContentType = "application/json" Return New Data(HttpContext.Current.Request("sEcho"), 2, 2, container) End Function Public Class Data Private _iTotalRecords As Integer Private _iTotalDisplayRecords As Integer Private _sEcho As Integer Private _sColumns As String Private _aaData As List(Of List(Of String)) Public Property sEcho() As Integer Get Return _sEcho End Get Set(ByVal value As Integer) _sEcho = value End Set End Property Public Property iTotalRecords() As Integer Get Return _iTotalRecords End Get Set(ByVal value As Integer) _iTotalRecords = value End Set End Property Public Property iTotalDisplayRecords() As Integer Get Return _iTotalDisplayRecords End Get Set(ByVal value As Integer) _iTotalDisplayRecords = value End Set End Property Public Property aaData() As List(Of List(Of String)) Get Return _aaData End Get Set(ByVal value As List(Of List(Of String))) _aaData = value End Set End Property Public Sub New(ByVal sEcho As Integer, ByVal iTotalRecords As Integer, ByVal iTotalDisplayRecords As Integer, ByVal aaData As List(Of List(Of String))) If sEcho <> 0 Then Me.sEcho = sEcho Me.iTotalRecords = iTotalRecords Me.iTotalDisplayRecords = iTotalDisplayRecords Me.aaData = aaData End Sub Returned JSON: {"__type":"Data","sEcho":0,"iTotalRecords":2,"iTotalDisplayRecords":2,"aaData":[["testing","chad","testing"],["testing2","chad","testing"]]}

    Read the article

  • How to make a tree view from MySQL and PHP and jquery

    - by Mac Taylor
    hey guys i need to show a treeview of my categories , saved in my mysql database . Database table : table : cats : columns: id,name,parent Here is a sample of what I want the markup to be like: <ul id="browser" class="filetree"> <li><span class="folder">Folder 1</span> <ul> <li><span class="file">Item 1.1</span></li> </ul> </li> <li><span class="folder">Folder 2</span> <ul> <li><span class="folder">Subfolder 2.1</span> <ul id="folder21"> <li><span class="file">File 2.1.1</span></li> <li><span class="file">File 2.1.2</span></li> </ul> </li> <li><span class="file">File 2.2</span></li> </ul> </li> <li><span class="file">File 4</span></li> </ul> i used this script to show treeview : http://www.dynamicdrive.com/dynamicindex1/treeview now problem is in php part : //function to build tree menu from db table test1 function tree_set($index) { global $menu; $q=mysql_query("select * from cats where parent='$index'"); if(!mysql_num_rows($q)) return; $menu .= '<ul>'."\n"; while($arr=mysql_fetch_assoc($q)) { $menu .= '<li>'; $menu .= '<span class="file">'.$arr['name'].'</span>';//you can add another output there $menu .=tree_set("".$arr['id'].""); $menu .= '</li>'."\n"; } $menu.= '</ul>'."\n"; return $menu; } //variable $menu must be defined before the function call $menu = ' <link rel="stylesheet" href="modules/Topics/includes/jquery.treeview.css" /> <script src="modules/Topics/includes/lib/jquery.cookie.js" type="text/javascript"></script> <script src="modules/Topics/includes/jquery.treeview.js" type="text/javascript"></script> <script type="text/javascript" src="modules/Topics/includes/demo/demo.js"></script> <ul id="browser" class="filetree">'."\n"; $menu .= tree_set(0); $menu .= '</ul>'; echo $menu; i even asked in this forum : http://forums.tizag.com/showthread.php?p=60649 problem is in php part of my codes that i mentioned . i cant show sub menus , i mean , really i dont know how to show sub menus is there any chance of a pro php coder helping me here ?

    Read the article

  • Wordpress and Jquery slide

    - by kwek-kwek
    I am integrating a Jquery slider inside of wordpress here is the demo of the slider. I can see the div that is their but for some reason it is not showing up. View the working site here Now my problem is that this code: <script type="text/javascript"> var _siteRoot='index.php',_root='index.php';</script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/scripts.js"></script> represents and index.html, but in wordpress I enabled permalinks. Any clue what would be the _siteRoot is? here is the complete code HEADER <script type="text/javascript"> var _siteRoot='index.php',_root='index.php';</script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/scripts.js"></script> Here are the images: <div id="slide-holder"> <div id="slide-runner"> <a href=""><img id="slide-img-1" src="images/nature-photo.png" class="slide" alt="" /></a> <a href=""><img id="slide-img-2" src="images/nature-photo1.png" class="slide" alt="" /></a> <a href=""><img id="slide-img-3" src="images/nature-photo2.png" class="slide" alt="" /></a> <a href=""><img id="slide-img-4" src="images/nature-photo3.png" class="slide" alt="" /></a> <a href=""><img id="slide-img-5" src="images/nature-photo4.png" class="slide" alt="" /></a> <a href=""><img id="slide-img-6" src="images/nature-photo4.png" class="slide" alt="" /></a> <a href=""><img id="slide-img-7" src="images/nature-photo6.png" class="slide" alt="" /></a> <div id="slide-controls"> <p id="slide-client" class="text"><strong>post: </strong><span></span></p> <p id="slide-desc" class="text"></p> <p id="slide-nav"></p> </div> </div> <!--content featured gallery here --> </div> And the footer <script type="text/javascript"> if(!window.slider) var slider={};slider.data=[{"id":"slide-img-1"},{"id":"slide-img-2"},{"id":"slide-img-3"},{"id":"slide-img-4"},{"id":"slide-img-5"},{"id":"slide-img-6"},{"id":"slide-img-7"},{"id":"slide-img-8"}]; </script>

    Read the article

  • jQuery sequence and function call problem

    - by Jonas
    Hi everyone, I'm very new to jquery and programming in general but I'm still trying to achieve something here. I use Fullcalendar to allow the users of my web application to insert an event in the database. The click on a day, view changes to agendaDay, then on a time of the day, and a dialog popup opens with a form. I am trying to combine validate (pre-jquery.1.4), jquery.form to post the form without page refresh The script calendar.php, included in several pages, defines the fullcalendar object and displays it in a div: $(document).ready(function() { function EventLoad() { $("#addEvent").validate({ rules: { calendar_title: "required", calendar_url: { required: false, maxlength: 100, url: true } }, messages: { calendar_title: "Title required", calendar_url: "Invalid URL format" }, success: function() { $('#addEvent').submit(function() { var options = { success: function() { $('#eventDialog').dialog('close'); $('#calendar').fullCalendar( 'refetchEvents' ); } }; // submit the form $(this).ajaxSubmit(options); // return false to prevent normal browser submit and page navigation return false; }); } }); } $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, theme: true, firstDay: 1, editable: false, events: "json-events.php?list=1&<?php echo $events_list; ?>", <?php if($_GET['page'] == 'home') echo "defaultView: 'agendaWeek',"; ?> eventClick: function(event) { if (event.url) { window.open(event.url); return false; } }, dayClick: function(date, allDay, jsEvent, view) { if (view.name == 'month') { $('#calendar').fullCalendar( 'changeView', 'agendaDay').fullCalendar( 'gotoDate', date ); }else{ if(allDay) { var timeStamp = $.fullCalendar.formatDate( date, 'dddd+dd+MMMM_u'); var $eventDialog = $('<div/>').load("json-events.php?<?php echo $events_list; ?>&new=1&all_day=1&timestamp=" + timeStamp, null, EventLoad).dialog({autoOpen:false,draggable: false, width: 675, modal:true, position:['center',202], resizable: false, title:'Add an Event'}); $eventDialog.dialog('open').attr('id','eventDialog'); } else { var timeStamp = $.fullCalendar.formatDate( date, 'dddd+dd+MMMM_u'); var $eventDialog = $('<div/>').load("json-events.php?<?php echo $events_list; ?>&new=1&all_day=0&timestamp=" + timeStamp, null, EventLoad).dialog({autoOpen:false,draggable: false, width: 675, modal:true, position:['center',202], resizable: false, title:'Add an Event'}); $eventDialog.dialog('open').attr('id','eventDialog');; } } } }); }); The script json-events.php contains the form and also the code to process the data from the submitted form. What happens when I test the whole thing: - first user click on a day, then time of day. Popup opens with time and date indicated on the form. When user submits the form, dialog closes and calendar refreshes its events.... and the event added by the user appears several times (from 4 to up to 11 times!). The form has been processed several times by the receiving php script?! - second user click, the popup opens, user submit empty form. Form is submitted (validate function not triggered) and user redirected to empty page json-events.php (ajaxForm not triggered either) Obviously, my code is wrong (and dirty as well, sorry). Why is the submitted form, submitted several time to receiving script and why is the javascript function EventLoad triggered only once ? Thank you very much for you help. This problem is killing me !

    Read the article

  • jQuery Map Highlight - works fine at DOM ready but failed when loaded by AJAX

    - by Michael Mao
    Hi all: This is uni assignment and I have already done some stuff. Please go to the password protected directory on : my server Enter username "uts" and password "10479475", both without quotes, into the prompt and you shall be able to see the webpage. Basically, if you hover your mouse on top of the contents in worldmap to the upperleft corner, you can see the underneath area is "highlighted" by a gray region and a red border. This is done using one jQuery plugin : at here This part works fine, however, after I use jQuery to load the specific continent map asynchronously, the newly loaded image cannot work correctly. Tested under Firebug, I can see the plugin doesn't "like" the new image cause I cannot find the canvas or other auto-generated stuff which can be founded around the worldmap. All the functionality is done in master.js, I believe you can just download a copy and check the code there. I do hope that I have followed the tutorials on the plugin's doc page, but I just cannot get through the final stage. Code used for worldmap in html: <img id="worldmap" src="./img/world.gif" alt="world.gif" width="398" height="200" class="map" usemap="#worldmap"/> <map name="worldmap"> <area class='continent' href="#" shape="poly" title="North_America" coords="1,39, 40,23, 123,13, 164,17, 159,40, 84,98, 64,111, 29,89" /> </map> Code used for worldmap in master.js //when DOM is ready, do something $(document).ready(function() { $('.map').maphilight(); //call the map highlight main function } On contrast, code used for specific continent map: //helper function to load specific continent map using AJAX function loadContinentMap(continent) { $('#continent-map-wrapper').children().remove(); //remove all children nodes first //inspiration taken from online : http://jqueryfordesigners.com/image-loading/ $('#continent-map-wrapper').append("<div id='loader' class='loading'><div>"); var img = new Image(); // wrap our new image in jQuery, then: // once the image has loaded, execute this code $(img).load(function () { $(this).hide(); // set the image hidden by default // with the holding div #loader, apply: // remove the loading class (so no background spinner), // then insert our image $('#loader').removeClass('loading').append(this); // fade our image in to create a nice effect $(this).fadeIn(); }).error(function () { // if there was an error loading the image, react accordingly // notify the user that the image could not be loaded $('#loader').removeClass('loading').append("<h1><div class='errormsg'>Loading image failed, please try again! If same error persists, please contact webmaster.</div></h1>"); }) //set a series of attributes to the img tag, these are for the map high lighting plugin. .attr('id', continent).attr('alt', '' + continent).attr('width', '576').attr('height', '300') .attr('usemap', '#city_' + continent).attr('class', 'citymap').attr('src', './img/' + continent + '.gif'); // *finally*, set the src attribute of the new image to our image //After image is loaded, apply the map highlighting plugin function again. $('.citymap').maphilight(); $('area.citymap').click(function() { alert($(this).attr('title') + ' is clicked!'); }); } Sorry about the messy code, havn't refactored it yet. I am wondering why the canvas disappers for the continent map. Did I do anything wrong. Any hint is much appreciated and thanks for any suggestion in advance!

    Read the article

< Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >