w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Convert html encoded string back into html elements jQuery/JavaScript
Here's a quick example. You just pass it into the other jQuery object's html function. JSFiddle HTML: <div id="someInfo">Hello, this is a simple example.<p>Boom, a paragraph.</p></div> <div id="storeHereLater"></div> CSS: $(function(){ var someInfoHTML = $('#someInfo').html(); $('#storeHereLater').html(someInfoHTML); });

Categories : Javascript

How to Convert the converted HTML tags back to the actual HTML Content
You have to use the same function, but this time with additional parameter 1. SELECT DBMS_XMLGEN.CONVERT ( '<p style=&quot;margin-bottom: 0pt;&quot;&gt;&lt;FONT color=#000080 size=2&gt;&lt;FONT color=#000080 size=2>;', 1) FROM DUAL

Categories : SQL

Insert html tag to a Database as a String and retrieve it back and show the html
Let's suppose that you have a view model and in the Text property you have retrieved the HTML value from the database: public class MyViewModel { public string Text { get; set; } } Now in your view you could use the @Html.Raw helper to avoid the output to be automatically HTML encoded: @model MyViewModel @Html.Raw(Model.Text) Needless to say that by doing this you are opening your site to XSS attacks if you do not sanitize the user input before outputing it. For example you could use the AntiXSS library.

Categories : C#

Save the client HTML content back to the Server as a HTML file
Even though I have no idea why you want to save the whole html code because I'm sure there will be parts that are the same for every user and you will be wasting memory, but ok. So there are two ways to do this: 1. is javascript as you said 2. would be to put all the generated html code into a hidden form input (already on server side) the first one seems more comprehensive and this is what I would do but the second one would also work for users with js disabled.

Categories : Javascript

return to index.html from images.html by using phone back button in phonegap android
Try putting $.mobile.phonegapNavigationEnabled = true in your mobileinit handler per http://jquerymobile.com/demos/1.2.0/docs/pages/phonegap.html instructions.

Categories : Javascript

Why does this HTML/JS revert back to the original after changing the inner HTML?
Because you're submitting the form, which is refreshing the page. Add return false to the inline handler, if you don't want to submit yet. <button value = "button!" onclick="doSomething(); return false;"> </button> Or add return before the call, and add return false to the function. <button value = "button!" onclick="return doSomething();"> </button> function doSomething() { document.getElementById("identifier").innerHTML = '<i>Ephemeral</i>'; return false; }

Categories : Javascript

LMERConvenienceFunctions error on back and forward fitting functions: model not a mer object
You are using an (older) version of the overhauled lme4 package that returns merMod objects instead of mer objects, and hence is not compatible with LMERConvenienceFunctions. I get the same error when using the soon-to-be-released version 1.0-4. If I install the latest version from CRAN instead (0.999999-2), no errors arise. I suggest removing your current lme4 and installing the latest from CRAN, and checking its version: > detach("package:lme4",unload=TRUE) > remove.packages("lme4") > install.packages("lme4") > packageVersion("lme4") [1] ‘0.999999.2’ This should fix your problems. Be aware, however, that you will lose the advantages of the new version. Also, in the coming days the new lme4 should appear on CRAN, breaking LMERConvenienceFunctions again if you update y

Categories : R

URL of Category page in Magento changed to /shop-3.html how to change it back to /shop.html
you can edit url write,i think there will be entry like /shop-3.html just change it is you want http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index and also refer http://www.magentocommerce.com/knowledge-base/entry/what-url-rewrites-are-and-why-they-are-important hope this will sure help you.

Categories : HTML

Getting back HTML from `div` element using jQuery
I don't know any other way to solve this other than to decode the entities like so var decode = function( val ) { var el = document.createElement('textarea'); el.innerHTML = val; return el.value; }; Here is a function that will do that for you and usage like this $('div').html('<h1>Hi, Alice & Bob</h1>'); console.log( decode( $('div').html() ) ); // Result is => <h1>Hi, Alice & Bob</h1> Demo

Categories : Jquery

Webview cannot go back with local html
coz in onReceivedError you change the url . so there will be no goback event you have to just show toast message and delete mWebView.loadUrl("file:///android_asset/offline.html");

Categories : Android

HTML Table in VB.Net back end code
You are looping one extra time, because of this logic: Dim numells As Integer = 6 For j As Integer = 0 To numells - 1 That equates to For j As Integer = 0 To 5, which is 6 iterations instead of 5. Change your declaration to this: Dim numells As Integer = 5 Now your For loop will iterate 5 times instead of 6. UPDATE: Your code is not creating a new row on each iteration through the For Each dr As DataRowView In dv loop. You need to create a new HtmlTableRow object each time, like this: For Each dr As DataRowView In dv ' Each time through this loop we need a new row object row = New HtmlTableRow() Dim crossover As String = dr("CrossoverID").ToString() Dim picid As String = dr("Description").ToString() Dim picdescrip As String = dr("DesignColor").ToString()

Categories : Asp Net

How Select Back & Next element with CSS in html Code
Take a look at CSS nth-chlid http://css-tricks.com/how-nth-child-works/ So you can create your example.

Categories : HTML

history.back() and html links problems
A better solution than counting clicks would be to pass the url of the previous page as a POST/GET parameter. Then instead of using history.back() you should redirect to the previous page: var url = ... // get the previous page url from the GET parameters window.location = url; In order to retrieve the GET parameter see: How to retrieve GET parameters from javascript?

Categories : Javascript

How to echo a lot of html with variables and functions?
Change it like this: <table> <tr> <td>Name:</td> <td><?=myFunction('foo');?></td> </tr> </table> That way you are actually opening a small PHP block in the template. <?= is a shorthand notation for <?php echo, although it depends on your server configuration if the shorthand is enabled. If the function doesn't return a value, but echos it instead, you can leave out the = as well and just execute the function like this: <? myFunction('foo'); ?> or the long notation: <?php myFunction('foo'); ?>. In general, you don't need <?php at the start of your file. It's just that everything inside <?php .. ?> tags is executed as php and the rest is considered static output. B.t.w. you don't need to use echo whe

Categories : PHP

Get the_permanlink () in html and then format in functions.php
If it's just about encoding an URL, the following would do: echo rawurlencode( get_the_permalink() ); You could also wrap that in a function: echo myrawurlencode( get_the_permalink() ); function myrawurlencode($url){ rawurlencode( $url ); } note: get_the_permalink() returns the URL, while the_permalink() echoes it directly by default. If you're going to use a class, you might want to take a look at http://php.net/manual/en/language.oop5.decon.php and http://www.php.net/manual/en/language.oop5.basic.php first.

Categories : PHP

setting html button to post back with confirm
If you analyze your inline handler, you'll see that postback is performed every time the button is clicked trough __doPostBack('ctl00$body$btnDelete','') if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(''); __doPostBack('ctl00$body$btnDelete','') // this line is always reached on click It doesn't matter if you return false from your jQuery click handler as inline code is executed anyway.

Categories : Jquery

HTML mini browser back button disabling
EDIT Answers to both questions asked: how can i somehow disable the back button when someone reaches the page they started with? You can't. how to know which page is currently being visited in the iframe? In this case, there isn't a way. For security reasons, just like you can't fetch content with AJAX from a source outside your site, you can't get the iframe url if outside your site.

Categories : HTML

html dom editing/adding attributes/functions
Just use jQuery. Then it's just a matter of doing something like the following: $(document).ready(function () { $('.change').click(function () { $(this).attr('class', 'new-value'); }); }); JSFiddle demo here.

Categories : Javascript

Update html div values in a js functions for loop
The below lines are the cause of error : var teamsbyname = "AAMG, thor, tturbo"; var team = teamsbyname.split(','); The array returned by them is: ["AAMG", " thor", " tturbo"] The second element is " thor". Mind the leading space. And you don't have a element in DOM with an id of " thor". So, to fix this, you have following 2 options: 1. Directly assign the values in an array instead of splitting the string. var team = ["AAMG", "thor", "tturbo"]; This will not only fix the problem but reduce the overhead of splitting the string in an array. 2. Or if you want to keep it in a string then change the var team declaration line to follwing: var team = teamsbyname.split(', '); i.e. add a space after the comma. It is recommended that you follow the first approach it is not only fi

Categories : Javascript

Razor @helper functions not rendering any Html
To render text with Razor you have to use the @ sign. If you change your code to @switch(Model.ValueTypeId) { case 1: @stringEditor() break; case 2: @intEditor() break; case 3: @boolEditor() break; case 4: @collectionEditor() break; default: @noEditor() break; } it should work. Alternative you can use Response.Write like this: @switch(Model.ValueTypeId) { case 1: Response.Write(stringEditor()); break; case 2: Response.Write(intEditor()); break; case 3: Response.Write(boolEditor()); break; case 4: Response.Write(collectionEditor()); break; default: Response.Write(noEditor()); break; } which is basically what the @ does in razor.

Categories : Asp Net Mvc

How to specify the root of the project to call JS functions from HTML
If you really need such a folder structure, use this as a path: ../../src/demo.js With each .. you basically go one level up inside your structure. You should do this, until you reach a folder, from which you can access the subfolders leading to your file. Do you really need such a deeply nested folder structure? Generally, I advice to use a rather flat folder structure. There are reasons to use more nesting, but I can't see any of them here.

Categories : Javascript

echo back $array[] elements to html form on Submit
You are getting "Array", because you are trying to print out variable of type Array. You probably want to give your fields separate names or indexes and do something like this: <form method="post"> <input type="checkbox" name="ANout[1]" value="AN1_OUT" <?php if(isset($_POST['ANout']) && in_array('AN1_OUT',$_POST['ANout']))echo'checked';?>> Voltage<input type="text"size="5"name="ANout[2]" value="<?php if(isset($_POST['ANout']) && !empty($_POST['ANout'][2])) echo $_POST['ANout'][2]; ?>"> <input type="submit" value="ok"> </form> (Just added form tags, submit button and isset checks to show working example.)

Categories : PHP

Html.Dropdownlist selected value is not posted back to the Controller from view
On your action Create, [HttpPost] version, in which variable are you expecting to see the value of your selected name? You've named your <select> element with id = "orgz", but you don't have a parameter to your action method named "orgz". Edit: When you do: @Html.DropDownList("orgz", (SelectList)ViewBag.orgz) You're going to end up with HTML like this: <select id="orgz" name="orgz">...</select> When the form is posted back to the controller action, it will try to find a variable called "orgz" that it will put the selected item from your <select> element into. You are missing this. Try changing your [HttpPost] version of Create to include an "orgz" variable: public ActionResult Create(TABLE_CODES dp, int orgz) { // orgz will contain the ID of the select

Categories : Asp Net

HTML - PHP, browser back button & the exact history of the page
<script> window.onload=function() { var someparm = <?php echo $size; ?>; // assuming a number, if not use quotes checkChange(someparm); } function checkChange(parm) { document.getElementById('save_button').disabled = (parm==0) ? true : document.getElementById('service_name_select').selectedIndex < 1 || document.getElementById('risk_rating_select').selectedIndex < 1 || document.getElementById('root_cause_select').selectedIndex < 1 || document.getElementById('impact_select').selectedIndex < 1 || document.getElementById('likelihood_select').selectedIndex < 1 || document.getElementById('efforts_select').selectedIndex < 1 || document.getElementById('client_name_select').selectedIndex < 1 || document.getElementById(

Categories : HTML

pjax: how to make back button re-request html from the server
To load the jquery added in your page, you need to call it after the pjax event is completed. To make it work also on browser's back/ forward button clicks, you can use pjax-end event. $("#pjax_container_id").bind('pjax:end', function() { // call your jquery functions }); Hope this would help you. Thanks.

Categories : Javascript

When do jQuery submit functions link themselves to HTML forms?
The first script $(document).ready(function () { $(document).on('submit','#UpdateUsers',function (e) { // delegated event with fixed els! e.preventDefault(); $('#results').contents().remove(); //Make sure all checkboxes are submitted var cb = this.getElementsByTagName('input'); //Get the inputs for(var i=0;i<cb.length;i++){ if(cb[i].type=='checkbox' && !cb[i].checked) // if this is an unchecked checkbox { cb[i].value = 0; // set the value to "off" cb[i].checked = true; // make sure it submits } } var formData = $(this).serialize(); $("input").prop("disabled", true); request = $.post('VRC_PublishersProcess.php', formData, resultsMessage); request.fail(function() { $('#results'

Categories : Jquery

Is there a limit to the number of javascript functions per HTML file?
Always check your JS console. This line is missing a parenthesis: x = parseInt(document.querySelectorAll('input[name="r2k_input"]')[0].value * (5 / 9); ^ If you're just getting the first element matched by your selector, use querySelector instead of querySelectorAll: document.querySelector('input[name="r2k_input"]').value Also, pass a radix argument to parseInt. Without that, numbers with leading zeroes will be interpreted as octals by some browsers: parseInt(..., 10);

Categories : Javascript

HTML email - TD hover to change back background-color not working
You inline style is taking precedence over the external td.blue-button:hover. Check this fiddle Extract the class td.blue-button { background-color: #006497; } td.blue-button:hover { background-color: #267aa6; }

Categories : HTML

Change back color of several contiguous HTML tags when user selects them
I have understood the following: Your extension changes the background color of the text (of the underlying paragraph-nodes) the user has selected in the webpage. Currently your implementation adds an EventListener to inject a span tag inside a paragraph-tag if the Event mouseup fires. You would like to know how to highlight the selected area (the nodes) if the user has selected more than a single leaf-node? Have i understood you correctly? As far as i have understood your question you could do the following. If multiple nodes are selected you could set the background-color on each node within the selected text: Based on this html: <h2>How to set background color of selected text</h2> <div> <h3 id="h">This is a headline</h3> <p id="

Categories : Javascript

Is there a way for an AJAX call to return both HTML content and callback functions?
jquery $.ajax supports callback after the request has been completed. Check the documentation -> http://api.jquery.com/jQuery.ajax/

Categories : Javascript

Multi-line HTML form text safely back to screen and into MySQL with PHP?
On your confirmation page, use two variables. One to print to the user and the other to submit to the database: $submittedText = $_POST['Text']; $processedText = nl2br(htmlentities($submittedText, ENT_QUOTES, 'UTF-8')); $sqltext = mysql_real_escape_string($submittedText); // use $sqltext to insert into the database // user $processedText to print to the user on the confirmation page. When you pull the text back out you can format the string again to whatever format you want to print to the user.

Categories : PHP

Navigation menu dont work while overriding back button HTML 5 History API
Your function might have had an extra brace in there. Reworked it using non-deprecated syntax. $(window).on('popstate', function(){ $.ajax({ url: location.pathname }) .done(function(data){ $('#ttl').html(data); }); });

Categories : Misc

two buttons referencing similar functions not working on html and javascript ajax
You have 2 elements with the same ID modaltrigger, ID of elements must be unique in a page. Use class attribute instead to group similar elements. <a href="#loginmodal" class="flatbtn modaltrigger">LOGIN</a> <a href="#contactmodal" class="flatbtn modaltrigger">CONTACT</a> then $('.modaltrigger').leanModal({ top: 110, overlay: 0.45, closeButton: ".hidemodal" });

Categories : Javascript

Creating excel-like tables with math functions that interact in different html pages and with SQL
There are probably a few questions here. I will address the one about the database tables and how to link them. If you set up a table for users and their details then another for sessions, a new entry to sessions should be created for each time a user logs in. This should have the user_id and timestamp enabling you to link data about dates with the users. Then any data you record about the data enter during the session should be stored in tables that reference the session_id so that you can bring all of the darts back together. This is obviously a very simplistic overview of the schema, but should give you some idea.

Categories : SQL

making jQuery Dialog to wait for post back or JavaScript prompt allowing custom html
I think Ajax Control Tool kit has something more suitable for you, please have a look at this demo.

Categories : Javascript

JavaScript: Need functions to convert a string containing binary to hex, then convert back to binary
Try this jsfiddle. The more interesting functions to you are here. Not necessarily the cleanest or most efficient ones, but yea: // converts binary string to a hexadecimal string // returns an object with key 'valid' to a boolean value, indicating // if the string is a valid binary string. // If 'valid' is true, the converted hex string can be obtained by // the 'result' key of the returned object function binaryToHex(s) { var i, k, part, accum, ret = ''; for (i = s.length-1; i >= 3; i -= 4) { // extract out in substrings of 4 and convert to hex part = s.substr(i+1-4, 4); accum = 0; for (k = 0; k < 4; k += 1) { if (part[k] !== '0' && part[k] !== '1') { // invalid character return { valid: fa

Categories : Javascript

HTML-form does not post back anymore after post with content-disposition
Well, the problem was something of my own. On the page a script was loaded which disabled all submit buttons after they where pressed to prevent multiple post backs. So no weird feature of bug, but a own made problem.

Categories : PHP

Store html into variable on click, erase from the DOM and put it back in on another click
Put the variable videoContent in the global scope: var videoContent = ''; $('#on-off').click(function(e) { e.preventDefault(); if (videoContent !== ""){ videoContent = $('#video-container').html(); $('#video-container').html(""); } else { $('#video-container').html(videoContent); } });

Categories : Javascript

How do I jump back in history directly, I don't want the go() function to call back() multiple times
I created my own function which I call when I need the behaviour as described above. It requires my own application layer implementation to be able to ignore routing callbacks for all but one of the abs(qty) history movements. goDirect = function (qty) { if (qty === -1 || qty === 1) { router.go(qty); return; } ignoreNavigations = Math.abs(qty) - 1; router.go(qty); }; The following code is used as the first line of route handlers: if (ignoreNavigations-- > 0) return; I did try simply setting a RouteEnabled flag to false when calling go(abs(qty)-1), before setting the flag back to true and calling a final go(-1), however it appears that response to the navigations occur asynchronously, and therefore I changed the implementation to the above code, rat

Categories : HTML

Several Tabs clicked (URL changed with hashes) then Browser-Back-Button one site Back?
Without specific HTML or javascript from your use case, it is hard to narrow in on the best approach. That said, there are really three important tools in your toolkit when dealing with history state and hashes. Preventing the change You can also avoid the whole problem by using event.preventDefault(); (docs) in the handler code for your tabs, something like this: $('.tab').on('click', function (e) { e.preventDefault(); ... }); When the user clicks the tab, you immediately call preventDefault -- this will stop the default action from continuing. In this case, you're preventing the default behavior of a link (presumably) changing the URL of the document. The ... indicates your existing code for handling the tab click action. All told (and again without seeing your use case), thi

Categories : Jquery



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