w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jquery - multiple elements of same class on page - only want to interact with one
You have to set an ID for each DIV that contains a comment. Why don't you use "comments_number" to count up your comments? Then, you would have a div with its very own ID and could easily select one with $('div#commentID') and do your stuff!

Categories : Jquery

Having trouble getting PHP file to interact properly with JQuery when trying to send email
To me, it looks like your not sending your post data through correctly in your AJAX request. You shouldn't be wrapping it in quotes it should look like this: data: { "body" : "value", "to" : "value", } Make sure you check your post data is coming through on your PHP side too. Also you can parse JS in PHP. (Your mail.php file)

Categories : PHP

Jquery bind on 'ajax:success', 'ajax:error' or 'ajax:complete' not executed even though form is submitted
In Jquery, Ajax Event has two types. One is local event, another is global event. Local Event, It will be defined with ajax request: $.ajax('YOUR PATH', {success: function(){ alert(!) }}); Global Event, It should be binded with document element: $(document).bind('ajaxSuccess', function() { alert('!'); }); see fiddle and jquery api

Categories : Jquery

Marklogic Json Xquery can't query
The elements you're trying to select are in a namespace that you need to specify in your XPaths; try this: xquery version "1.0-ml"; declare namespace html = "http://www.w3.org/1999/xhtml"; declare namespace json = "http://marklogic.com/xdmp/json/basic"; for $r in doc()/json:json let $b:=$r/json:id return ( $b)

Categories : Json

Data relationships as a context for search in Marklogic
All of these ideas would work fine. Deciding which to use depends on particulars of your application such as how often the main document is changed (and are you in control of it), how hard it is to remodel your XML. Another thing to consider is you can set a trigger on document updates which could perform the collection changes automatically. -David Lee

Categories : Search

MarkLogic 5 return elements wrapped in CDATA
Curious could you refer to any of the "All documentation I can find" which says MarkLogic will output CDATA nodes ?." In any case why do you need CDATA sections ? The text will be encoded properly and parsable by XSLT without CDATA. There is no technical reason CDATA is ever needed in XML, its there solely for the purposes of human editing to make it easier to not have to encode every invalid charactor individaully. If you remove the CDATA markers from your sample it will work fine without them. -David

Categories : Xml

How many concurrent connections can MarkLogic server process?
Given a large enough budget there is no practical limit on the number of concurrent connections. The basic limit is the application server thread count, although excess requests will also pile up in the backlog queue. According to groups.xsd each application server is limited to at most 256 threads. The backlog seems to have no maximum, but most operating systems will silently limit it to something between 256-4096. So depending on whether or not you count the backlog, a single app server on a single host could have 256-4352 concurrent connections. After that you can use multiple app servers, and add hosts to the cluster. Use a load balancer if necessary. Most operating systems will impose a limit of around 32,000 - 64,000 open sockets per host, but there is no hard limit on the number o

Categories : Performance

Performance Advantages in Storing Documents as JSON in MarkLogic 6
MarkLogic is XML-native and does need to convert JSON to XML to store it in the database. There is a high-level JSON library to perform transformations. The main functions are json:transform-to-json and json:transform-from-json, and when configured correctly should provide lossless conversions. I think the main difference from your example is whether you want to convert to XML using your own process or use MarkLogic's toolkit. For more detailed information, see MarkLogic's docs: http://docs.marklogic.com/guide/app-dev/json

Categories : Json

Marklogic - Interrupting a long running query with a database restart
Yes, in general canceling an update query will roll back any changes it tried to make. You can think of this like a stack: every update in your query goes into a stack, taking any necessary locks as it goes. After all the expressions have been evaluated, the update enters commit phase and applies that stack atomically to the database. If the query is interrupted before that atomic commit, none of the changes are durable. This behavior covers the A=atomic and D=durable aspects of the ACID properties common to transactional DBMS implementations. There are some exceptions. It is possible to structure an update so that work is applied in granular sub-transactions. One way to do that is with a multi-statement transaction. See http://docs.marklogic.com/guide/app-dev/transactions for more.

Categories : Misc

Listing/searching/paginating over documents using Marklogic's Java API and JAXB
Dat Silencer: To have search return entire documents, you can set up query options to return the entire document as the snippet: <transform-results apply="raw"/> Then, on the client, you can pass the contents of search results that were persisted by JAXB through the JAXB unmarshaller to hydrate the Java objects. As an alternative, the Java API includes the SearchCollector example, which returns a multipart / mixed payload where each part is a search result document. Documents that were persisted via JAXB can then be unmarshalled. Specifics aside, the general strategy is quite sensible -- take advantage of MarkLogic search to fetch the persisted objects of interest using any field of the object or subject. The primary key, of course, still has value for direct access. That is

Categories : Java

saxon:evaluate equivalent for MarkLogic xdmp:xslt-eval
The closest equivalents are http://docs.marklogic.com/xdmp:unpath http://docs.marklogic.com/xdmp:value and http://docs.marklogic.com/xdmp:eval

Categories : Xslt

jQuery Ajax:- How to remove pending ajax call and active recent ajax call?
You can do like this. var CurrentAjaxReq = null; if(CurrentAjaxReq != null) { CurrentAjaxReq.abort(); } CurrentAjaxReq = jQuery.ajax({url: '/xyz.php', success: function(data) { CurrentAjaxReq = null; //do something } });

Categories : Ajax

Document XPath searching with Marklogic's Java search API vs XQuery/XSLT API
Background: the Java API is a layer on the REST API is a layer on the Search API is a layer on cts:search You can express this query in the Search API. Use a searchable expression for the first parameter in your query options http://docs.marklogic.com/guide/search-dev/search-api#id_43671 Use an empty and query for the structured query http://docs.marklogic.com/guide/search-dev/structured-query#id_83674 Using the Java API, you can search using the query options and structured query as a RawCombinedQueryDefinition. All that said, you could just also search for an element-query on bfa:AppUser containing a value constraint query on bfa:appAccess/@appRole of "ROLE_SYS_ADMIN" While XPath can be convenient, it's a good idea to become conversant in query expressions to understand the full

Categories : Java

jQuery: Can I send and receive an $.ajax response while a longer $.ajax request is pending?
Instead of doing an ajax post you can post to an iframe and have php generate incremental output and send it with the flush command. // send a hash mark for every 1000 inserts $a = 0; while ($rec = getDataForNextInsert()){ $a++; // do insert if ($a%1000 == 0) { echo '#'; flush(); } } It would also then be possible to poll the contents of the iframe to provide a pretty display for the end user.

Categories : PHP

Jquery AJAX Global Timeout (Entire Application) Im using $.get & $.post (can't use $.ajax)
You can attach an ajaxError handler to document $(function(){ $(document).ajaxError(function(event, request, settings) { //Do whatever }); }); Edit: To set Ajax timeout globally, you have to use ajaxSetup $.ajaxSetup({ timeout: 2000 //Time in milliseconds }); Note:$.ajaxSetup should be set before other Ajax calls.

Categories : Jquery

Diffence between usage of Ajax Update Panel and Jquery:ajax() method
An update panel performs a full re-render of the page, takes the section matching the panel and sends it back to the client. The browser then replaces the contents of the update panel with the new html. jQuery's AJAX method allows you to make any request to any page and handle the response data any way you choose. This might include reading a JSON response from a web service, getting html or anything else you wish. Effectively AJAX gives you a mechanism to emulate the user browsing to a given url with GET or POST data and manipulate the results in any way you desire. It's worth noting that the update panel is built on top of AJAX (technically Javascript's XMLHttpRequest) object. There are also some gotchas with update panel, eg if you have a Captcha that is outside the panel; When the

Categories : Asp Net

Checking username on local server using jquery, ajax and php ajax() not connecting
I always like to use GET request on AJAX issues, meaning to do jQuery AJAX with type:"GET" and read the parameter with GET on PHP.. So I can easily test the PHP page itself by running it in the browser like this localhost/ajax_check_username.php?username=something

Categories : PHP

$.ajax textstatus shows success but database is not updated?Jquery php ajax
I think you have an error in your SQL syntax, you should remove te "," before VALUES. If that doesn't work check MySQL errors with mysql_query("QUERY") or die(myql_error());

Categories : PHP

jQuery.ajax reloads page instead of performing ajax request in Safari on iOS
All that is needed to make this work is a return false; from the handler function. See event.preventDefault() vs. return false for a more complete explanation, but basically "return false from within a jQuery event handler is effectively the same as calling both e.preventDefault and e.stopPropagation on the passed jQuery.Event object." So a fully functional version of the above code is: getInfo = function() { $.ajax({ url: '/test/info', dataType: 'html', success: function(data, textStatus) { if ( textStatus == 'success' ) { // doing stuff with data } } }); return false; }; // The order of vv that string may be important $(document).on('click touchend', '.getInfo', getInfo );

Categories : IOS

nonce token after ajax response and hash problems using ajax jquery type json
To change hash function, if only '+' is the problem you may keep a check while creating the string, next_char = Randomly-created-char; if(next_char == '+'){ //do nothing } else{ hash .= next_char; } Here is how the html and php files should be like. The ajax call is shown in the .html file. .php that loads your form for the first time. <!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#check").click(function(){ $("#keyvalue").text($("#key").val()); }); $("#submit").click(function(){ var text = $("#text").val(); var key = $("#key").val(); $.ajax({ url: 'trial.php',

Categories : PHP

How to get a part of HTML webpage in a jQuery ajax Request? In other words how to filter the web page contents on an ajax call?
success:function(data) { var out = ""; $(data).find("your selectors").each(function(loop, item){ out += $(item).html(); }); data = out; alert(data); $("body").html(data); }

Categories : Javascript

how to change type ajax call to controller of option "serviceUrl" in ajax autocomplete jquery devbridge with CodeIgniter?
I fixed my problems, but data that contains values for callback function when data is selected always null. What's up? MY SCRIPT: var options, a; $(document).ready(function(){ options = { serviceUrl:'controller_name/function_test', onSelect: function(suggestion) { alert('You selected ' + suggestion.value + ', ' + suggestion.data); } }; a = $('#search_by_user').autocomplete(options); }); MY FUNCTION IN CONTROLLER : public function function_test() { $query = isset($_GET['query']) ? $_GET['query'] : FALSE; //$query = 'te'; if($query) { $found = $this->model_name->get_list($query); $suggestions = array(); $data = array(); foreach($found as $row) {

Categories : Codeigniter

jquery ajax loading gif while waiting for ajax response
If you set async: false, you're telling the browser to synchronize to that function's call responding, meaning it is going to wait. Remove or set to true and it will run asynchronously, e.g., will not freeze the browser waiting for it to finish.

Categories : Javascript

Getting TypeError: $.ajax(...).done is not a function [Ajax, Jquery ]
try using success function inside ajax function , $(document).ready(function() { alert('in get'); $.ajax({ data: { 'contentId':contentId, 'USER_ID':USER_ID, 'actionType':'GETRATING', 'portletGuid':portletGuid }, type:'GET', url:ajaxRatingServlet, cache:false, success: function(response) { getUserPreference(response); } }); });

Categories : Javascript

jQuery $.ajax equivalent for Ajax.updater
You could subscribe to the success callback and update the contents of the corresponding DOM element: $.ajax({ url: 'ajax/get_folders.php', data: { category: $('#category').val(), office: $('#office').val() }, success: function(result) { $('#folder').html(result); } }); or simply use the load function: var parameters = { category: $('#category').val(), office: $('#office').val() }; $('#folder').load('ajax/get_folders.php', parameters);

Categories : Jquery

jQuery AJAX on div not working after jQuery AJAX on another div
You need to bind the events under the showLogs file. Because whenever you call the delete or other events, it replace the html with the updated one. and the events lots it existance. So you need to call them in the showLogs file.

Categories : PHP

Mysterious behavior of ajax jquery request inside jquery tabs
There is no need to check if(json.status == '1'){ alert("Added!"); }else{ alert("Problema!"); } only if the request is success success function() gets executed Try this If to check some error in ajax call,I have added an error:function(),which will alert the error if error occurs function formSubmition(){ $recId = $("#recId").val(); $collectionDate = $("#collectionDate").val(); $collectorsName = $("#collectorsName").val(); $donorsName = $("#donorsName").val(); $sciName = $("#sciName").val(); $family = $("#family").val(); $comName = $("#comName").val(); $variety = $("#variety").val(); $area = $("#area").val(); $l

Categories : Jquery

How to inspect the successful result of a jQuery AJAX request and abort the jQuery.load() before it inserts the content?
On your server side code, you should be able to display a success response or the data you passed. You can use firebug console (for firefox) to display the ajax results. Alternatively you can use chrome developer tools. In your console, just activate LogXMLHttpRequests by right clicking on it. The network inspector of firebug and chrome developer tools also displays Ajax responses in the XHR tab.

Categories : Javascript

jQuery:Parsing an ajax HTML page result with jQuery
Due to Same Origin Policy, you can't make an ajax call to Google because their domain is different to that of your code. Suggested solution is to proxy the request through a server side script that resides on the same domain, and either make a HTTP request to get the search results or use the Custom Search API.

Categories : Jquery

jQuery - How to pass multiple callback functions in jQuery ajax
You could easily define one callback function in which you would call multiple ones. $.ajax({ url: url, dataType: 'json', success: myGlobalCallback(data) }); function myGlobalCallback(data) { cb1(data); cb2(data); }

Categories : Jquery

jQuery - How to return a value from jQuery function (not an ajax call)
Try making your handler and giving it a variable to store the results. Then you can manipulate the variable however you like var position = {}, // store position here mouseMoveHandler = function(e){ position.pageX = e.pageX; position.pageY = e.pageY; myFunction(); // you have to call your function after the position results are populated }; // your function that handles the results var myFunction = function(){ alert(position.pageX+', '+position.pageY); }; // give your handler to mousemove jQuery(document).ready(function(){ jQuery("#target").mousemove(mouseMoveHandler); }); // every time mousemove is triggered, the results will be in 'position' variable an example -> http://jsfiddle.net/eXVKg/

Categories : Jquery

MarkLogic search:search not returning snippets
I seem to have found the problem. The xml being searched looks like this: <lecture objectType="lecture"> <city>Vancouver</city> <state>British Columbia</state> <country>Canada</country> <formattedTranscript> <body class="lecture-transcript" xmlns="http://www.w3.org/1999/xhtml"> ... The city constraint looks like this: <constraint name="city"> <range type="xs:string" facet="true"> <element ns="" name="city"/> <facet-option>frequency-order</facet-option> <facet-option>descending</facet-option> </range> </constraint>" I had the following statement in my $options declaration: <searchable-expression> //(fo

Categories : Search

jQuery Ajax Progress - how to not inherit progress percentage on different ajax requests?
This will store the value of _which for reuse when the handlers get called: function(_which, file_name) { $.ajax(... same as the code you have ... }(_which, file_name); What this does is create a closure that holds the values of the two variables you use in the callback (handler) functions you pass to the ajax call. By doing this you are still sharing the functions (e.g. progress) but you are not sharing the values of _which and file_name that are used in those functions. You would, of course, be adding the 1st and 3rd lines around your entire call toe $.ajax If you add more variables that are set outside but used inside those handler functions, you will need to add them to the closure as well. There are other ways to do this but this is minimal change to your code. For example

Categories : Javascript

How to interact with @autoreleasepool
At the end of the @autoreleasepool block, the autoreleased objects are sent a release message. If you want to reimplement the autorelease method, you may not want to directly send release messages to your NSObjectsubclass. If so, reimplementing release with some special behavior could do your business.

Categories : Objective C

How do Netlink and security interact with each other?
facepalm From RFC 3549: Netlink lives in a trusted environment of a single host separated by kernel and user space. Linux capabilities ensure that only someone with CAP_NET_ADMIN capability (typically, the root user) is allowed to open sockets. The kernel is supposed to be the one who tells whether the module should let the user proceed or not, not Netlink. OBVIOUSLY. Just block by coding in kernelspace /* If the current thread of execution doesn't have the proper privileges... */ if (!capable(CAP_NET_ADMIN)) { /* Or CAP_SYS_ADMIN or whatever */ /* Throw this request away. */ return -EPERM; , done. Thanks to ipclouds and tadokoro for guiding me in the right direction.

Categories : Linux

How do bind, put and return interact here?
When I test both functions with the same initial state, I get the same answer: λ> evalState rollDie (mkStdGen 0) 6 λ> evalState rollDie2 (mkStdGen 0) 6 I suspect you're not using the same state for both tests. How exactly are you testing the functions? Here's an example where the state (i.e. the random number generator) gets modified: test :: GeneratorState (Int, Int) test = do a <- rollDie -- modifies the state! b <- rollDie2 -- gets a different state return (a, b) runTest :: IO () runTest = do g <- getStdGen let (a, b) = evalState test g print a print b As you can see, when you run this you get two different answers. λ> runTest 4 2

Categories : Haskell

Does flury interact with asynctaks?
It is known bag and there is answer http://support.flurry.com/index.php?title=Guides/s/Publishers/Tips/Android It is nesessary slightly extend onStart() public void onStart() { super.onStart(); // Add the following code to your main Activity before calling FlurryAgent.onStartSession(): // workaround for AsyncTask issue try { Class.forName("android.os.AsyncTask"); } catch (ClassNotFoundException e) { e.printStackTrace(); } FlurryAgent.onStartSession(this, YOUR_API_KEY); //your code }

Categories : Android

How to interact between multiple VB projects
I've had this before, you have Project A which refernces Project B, but Project B cannot reference Project A because that would create a circular reference. What I have done in the past is use normal direct methods from Project A to act on Project B, but define events in Project B that your code in Project A can subscribe to and then handle. Depends on exactly what you are trying to do, but I've used this where a form from Project B is launched from project A, but that from has a button that will launch a form in Project A. So I added an event to Project B's form, that I subscribe to that while launching the form from Project A, when the event gets fired by Project B the code in project A can launch the correct form. All in all a good workaround, but if you are doing this, in may mean yo

Categories : Vb.Net

Python : How can two GTK widgets interact with each other?
First of all i don't know anything about python but i have some experiences with gtk+ and i'm more or less familiar with its concepts. The first thing i noticed is that you define a class called GUI and two separate classes called Buttons and Lister. For me such approach makes only sense if you design the two last mentioned classes in a way that they are a kind of (composite) widget theirselves. So that you can instantiate them at a higher level for example in the GUI class. This would be a generic approach and makes perfectly sense if you want to reuse these new widgets. The way you did it doesn't make sense to me. From what i have gathered so far the actual aim of Buttons and Lister is to populate your main application window with widgets, to connect callbacks to signals of those widg

Categories : Python

Web service to interact with sharepoint
SharePoint supports WebDAV and that can be used to get individual files provided you know where they are already. However a word of caution, this does require that the domain user that use to get the file must have the "File Browse" permission I believe.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.