I want remove classes which are created dynamically using jQuery.
I have a dynamic classes in table like:
"dynamicHeader","record1","record2","record3"
I want to remove all classes class name contain 'record'. Thanks Advance.
via Chebli Mohamed
I want remove classes which are created dynamically using jQuery.
I have a dynamic classes in table like:
"dynamicHeader","record1","record2","record3"
I want to remove all classes class name contain 'record'. Thanks Advance.
I have a html page which contains a table in it and I have add that page into my asp.net project. Now I want freeze the panes(fix 1st five rows as header and 1st column) without modifying the html page..
In that html page the table did not contain 'thead', 'tbody' and 'th' tags.
It just like this...
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
I don't want to add 'th', 'thead' tags to my html page... because I don't want modify my page... I think we may add them and freeze the panes dynamically.....
I have an automcomplete working using the method below. I type in and it returns the user name of the individual I am searching for and it also shows me the ID of the user if I want to. However, what I require is for the FIRST and LAST NAME to show in the input box but the actual value (ID) to be passed when the form is submitted. So how to I get the value of the input type to be the ID but show the drop down as first and last name?
HTML
<input type='search' id='nameSearch' placeholder='Search User' />
SCRIPT
<script>
$(document).ready(function(){
$('#nameSearch').autocomplete({
source:'results.php',
minLength:1,
select: function(event, ui){
// just in case you want to see the ID
var accountVal = ui.item.value;
console.log(accountVal);
// now set the label in the textbox
var accountText = ui.item.label;
$('#nameSearch').val(accountText);
return false;
},
focus: function( event, ui ) {
// this is to prevent showing an ID in the textbox instead of name
// when the user tries to select using the up/down arrow of his keyboard
$( "#nameSearch" ).val( ui.item.label );
return false;
},
});
});
</script>
SQL
include "libs/db_connect.php";
// get the search term
$search_term = isset($_REQUEST['term']) ? $_REQUEST['term'] : "";
// write your query to search for data
$query = "SELECT
ID, NAME, LAST_NAME
FROM
b_user
WHERE
NAME LIKE \"%{$search_term}%\" OR
LAST_NAME LIKE \"%{$search_term}%\"
LIMIT 0,10";
$stmt = $con->prepare( $query );
$stmt->execute();
// get the number of records returned
$num = $stmt->rowCount();
if($num>0){
// this array will become JSON later
$data = array();
// loop through the returned data
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
$data[] = array(
'label' => $NAME . " " . $LAST_NAME,
'value' => $ID
);
}
// convert the array to JSON
echo json_encode($data);
}
//if no records found, display nothing
else{
die();
}
previously we used to have fineuploader version called custom, which was a jquery wrapper and we had both azure upload to blob + traditional upload to your server
in the new version 5.2 when I call the fineUploader() method to upload to our own server it gives out errors.
I need some help with how to get a variable from another PHP script to a JQuery in my index.php file.
On my webpage I have the ability to search a database and this is done by the click of a button which performs the search and displays the results in another div on the page.
This part of the webpage work fine.
What I would like to do next is for another button to be able to download a text file with the results of my query. The result is calculated in another PHP file, the same one that displays it.
My JQuery in index.php looks something like:
<script>
$(document).ready(function(){
$("#querySubmitButton").click(function(evt){
evt.preventDefault(); // stops the submit taking place
var myQuery = $('#queryText').val(); // get the query value
$('#container').load('getData.php', { query:myQuery });
});
$("#selectButton").click(function(evt){
evt.preventDefault();
var selectQuery = $( "#selectBox" ).val();
$('#container').load('getData.php', { query:selectQuery });
});
$("#downloadButton").click(function(evt){
alert($result); //Somehow alert the $result variable from my getData.php file, to make sure that I can receive it and perform further things on it so that it is downloaded as a document.
});
});
</script>
As I use the getData.php file for displaying my result in another div, I can't echo $result and use it in JSon?? because that will also be displayed on my webpage, which I of course do not what.
Is this possible somehow?
Thank you for any help. //Ambrose
Here is my code in getData.php if that is of help:
$conn = pg_connect("dbname=xxx user=xxxxxxx password=xxxxxxxx");
if (!$conn) {
die("Error in connection: " . pg_last_error());
}
$query =$_POST['query'];
$result = pg_query($query);
if (!$result) {
echo "Problem with query " . $query . "<br/>";
echo pg_last_error();
exit();
}
else{
if(empty($result)){
echo"Tom";
}
else{
echo "<table class='resultTable'><tr>";
$i=0;
while ($i < pg_num_fields($result))
{
$fieldName = pg_field_name($result, $i);
echo '<td>' . $fieldName . '</td>';
$i = $i + 1;
}
echo '</tr>';
while($row = pg_fetch_assoc($result)) {
echo "<tr>";
foreach ($row as $key => $value){
echo "<td>" . $value . "</td>";
}
echo "</tr>";
}
echo "</table>";
}
}
I am developing a SAPUI5 in order to upload files [mainly XML ]. I have implemented the view using XML views within the WebIDE as well as the corresponding JS controller, which is calling an oData service matched with 'create_stream' method then doing the job of reading the file content.
All is working fine but then I cannot receive the response containing the file content [parsed] from the oData back to my js controller.
Here is my ajax call, actually there are two calls but the first one is used to get the necessary security csrf token only.
jQuery.ajax({url : Service1,
type : "GET",
async: false,
beforeSend : function(xhr) {
xhr.setRequestHeader("X-CSRF-Token", "Fetch");
},
success : function(data, textStatus, XMLHttpRequest) {
token = XMLHttpRequest.getResponseHeader("X-CSRF-Token");
}
});
$.ajaxSetup({
cache : false
});
jQuery.ajax({
url : service_url,
async : false,
dataType : "text",
cache : false,
data : filedata,
type : "POST",
beforeSend : function(xhr) {
xhr.setRequestHeader("X-CSRF-Token", token);
xhr.setRequestHeader("Content-Type", "application/text;charset=UTF-8");
},
success : function(odata) {
oDialog.setTitle("File Uploaded");
oDialog.open();
document.location.reload(true);
},
error : function(odata) {
oDialog.setTitle("File NOT Uploaded");
oDialog.open();
document.location.reload(true);
}
});
Can anyone find where I am wrong within this flow ?
I think the problem might be in the ajax call, maybe in the parameters or in the way I am getting the data as response from the oData service ?
Or the issue could be whithin the oData create_stream method ?
I am using jquery.tipTip to display text on image’s mouseover but it randomly activates and displays the text when there is no mouseover on the image.
$('.tooltip').tipTip({maxWidth: 'auto', edgeOffset: 5, defaultPosition: 'top', keepAlive: false, activation: "hover"}); [![enter image description here][1]][1]