I want to insert a text in last p tag which is returning from tinyMCE by the following code
var html = tinyMCE.activeEditor.getContent();
For this I am using the following jquery code
tinyMCE.init({
mode : "textareas",
theme : "advanced"
});
$(document).ready(function(){
$("a[title='click_to_add']").click(function() {
var html = tinyMCE.activeEditor.getContent();
html = $("#p:last").text();
alert(html);
name = $(this).html();
content = html+" "+name;
tinyMCE.activeEditor.setContent(content);
return false;
});
});
But it is not working.The HTML code is given below
<div style="float:left;">
<textarea id="mail_body" name="mail_body" rows="15" cols="80" style="width:575px;"></textarea>
</div>
<div id="aaa">
<a href="#" id="news_user" title="click_to_add"> < name > </a>
</div>
Please give us a solution for this problem.
Say I have my class
@interface Person : NSObject { NSString *name; }
I need to get the name of NSString's within my class
Person *person = [[Person alloc] init];
NSLog(@"Name of variable %s\n", NameofVariable(person.name));
I have very little programming knowledge; only a fair bit in Visual Basic.
How do I take a value from a text field, then do some simple math such as divide the value by two, then display it back to the user in the same field?
In Visual Basic you could just do txtBoxOne.text = txtBoxOne.text / 2
I understand this question is more than one question and is very basic stuff, but I need to get my head out of Visual Basic and into where I should be :)
I'm building dynamic forms based on a partial view. My view inherits a model with a single property: CatalogName { get; set; }.
I have tried this:
@Html.Label(Model.CatalogName + "-ProductNumber", "Product Number")
@Html.TextBox(Model.CatalogName + "-ProductNumber")
The HTML renders like this though:
<label for>Product Number</label>
<input name="CatatalogName-ProductNumber" type="text" />
If I write my code like this:
@Html.Label("ProductNumber-" + Model.CatalogName", "Product Number")
It will render the way I expect
<label for="ProductNumber-CatalogName">Product Number</label>
Is this a bug with MVC? Are there any answers to why my concatenation won't work the way I want it in the label, but works fine with the TextBox?
DECLARE @STR_IDS VARCHAR(15)
SET @STR_IDS='7,15,18'
UPDATE TBL_USERS WHERE ID IN @STR_IDS
I know the update statement would not work as the ID is of type INT and i am replacing a varachar value there .How can i change the query so that it will be executed like this in effect ?
UPDATE TBL_USERS WHERE ID IN (7,15,18)
Thanks in advace
Hi frns,
Am using the strip_tags() to remove the HTML tags from one content . but i wants to remove the html (<DIV></DIV>,<P></P>,<SPAN></SPAN>) tags apart from the <img> tag and <a> , i don't want to remove the <img ><a> tag from that . but need to remove other all html tags from that content how can i do help me.
thanks
Theres a problem. I can't set value of BorderBrush fros C#-code (not in XAML):
((Border)((Image)sender).Parent).BorderBrush = "#FFBCC7D8";
How to solve this problem?
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL Server 2005
Hello,
I am a regex idiot and never found a good tutorial (links welcome, as well as a pointer to an interactive VS2010 integrated editor).
I need to parse strings in the following form:
[a/b]:c/d
a, b: double with "." as possible separator. CAN be empty
c: double with "." as separator
d: integer, positive
I.e. valid strings are:
[/]:0.25/2
[-0.5/0.5]:0.05/2
[/0.1]:0.05/2
;) Anyone can help?
Thanks
What is the basic setup on the subject?
Let say I have a QByteArray, and I need to encrypt it with simple password.
And then decrypt it in another piece of code
Just a very simple setup
Sorry for such a simple question but I can't seem to find the solution.
I am trying to fade in and out some divs.
Divs have an ID of "div1", "div2", "div3".
My code is:
var Divs = new Array("div1", "div2", "div3");
I want to fade out one div and then fade in the next on top of it.
I have a setinterval that runs every 5 seconds and checked it works.
Inside it is this code:
$(Divs[1]).fadeOut(1000);
$(Divs[2]).fadeIn(1000);
However nothing happens when the timer method is ran. Any ideas?
Hi,
I've inherited a project which we are trying to migrate to MySQL 5 from MySQL 4.0(!) and from myISAM to InnoDB. Queries are now falling down because they are being constructed using an ADODB connection's -qstr() on all parameters, including ints. Where no value is provided I end up with:
INSERT INTO tablename VALUES ('', 'stuff'...)
where the first column is an auto_increment. This causes an error (fair enough since '' isn't an int). Is there a switch in MySQL to make it behave as it used to (I assume it just silently converted to 0?)
Thanks.
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL SERVER 2005
I see extra characters like â showing because of encoding issues as I found out here -
HTML encoding issues - "Â" character showing up instead of " "
I understand that if I set the browser meta encoding to UTF-8, these will not affect anything but I need to strip these extra characters from the database for other purposes.
For eg. :
Text: ↑ should be become Text: ?
But if I run it through utf8_decode it gives me Text: ???
For every other occurrence of the â character, it converts properly to a blank space. Any help will be appreciated.
PHP newbie here.. I am trying to create a function where the user is redirected back to the previous page after adding an item to their cart. However, when they are redirected back with the code below it leaves a duplicate of the directory (ie. example.com/catalog/garden-tools/garden-tools
function custom_add_to_cart_redirect() {
$_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$url = explode('/', rtrim($_SERVER['REQUEST_URI_PATH'], '/'));
return $url[3];
}
A print_r reveals the following:
Array ( [0] => [1] => thefarmshop [2] => catalog [3] => garden-tools [4] => gardening-glove )
What could the issue be?
i have question from programming pearls
problem is following
show how to use lomuto's partitioning scheme to sort varying length bit strings in time proportional to the sum oof their length
and algorithm is following
each record in x[0..n-1] has an integer length and pointer to the array bit[0..length-1]
code
void bsort(l,u,depth){
if (l>=u)
return;
for (int i=l;i<u;i++)
if (x[i].length<depth)
swap(i,l++);
m=l;
if (x[i].bit[depth] ==0)
swap(i,m++);
bsort(l,m-1,depth+1);
bsort(m,u,depth+1);
please help me
i need following things
1. how this algorith works
2.how implement in java?
What I have is a C# windows app that reads a bunch of SQL tables and creates a bunch of queries based on the results. What I'm having a small issue with is the final "," on my query
This is what I have
ColumnX,
from
I need to read the entire file, write out exactly what is in the file and just replace the last , before the from with nothing.
I tried .replace(@",\n\nfrom),(@"\n\nfrom) but it's not finding it. Any help is appreciated.
Example:
ColumnX,
from
Result:
ColumnX
from
I am currently trying to build a very basic serial shell with my arduino.
I am able to get an output from the device using Serial.read() and can get the character it has outputted, but I cannot work out how to then add that character to a longer to form the full command.
I tried the logical thing but it doesn't work:
char Command[];
void loop(){
if(Serial.available() > 0){
int clinput = Serial.read();
Command = Command + char(clinput);
}
Can anybody help? Thank You.
Hi,
having a FileStream that I read with a StreamReader (it is a very large file), how can I set the Seek position of the FileStream to the first occurrence of a certain substring so that I can start reading this large file from a given point?
Thanks
I am using a tableview with a search function and is populated by a plist. I want to pass 2 strings through to a DetailView. But I can only get the sting used to populate the cell to pass over. I have tried many variations but can't figure it out. Any help would be greatly appreciated.
DetailView *nextLevel = [DetailView alloc];
NSString *valueString;
NSString *selectedTitle;
if (arraySearch == nil) {
NSString *key = [arrayDataKeys objectAtIndex:indexPath.section];
NSArray *nameSection = [dictAllData objectForKey:key];
NSDictionary *dict = [nameSection objectAtIndex:indexPath.row];
valueString = [dict objectForKey:@"name"];
selectedTitle = [dict objectForKey:@"word"];
} else {
valueString = [arraySearch objectAtIndex:indexPath.row];
**selectedTitle = [arraySearch objectAtIndex:indexPath.row];** //Obviously this is wrong but this is the line I need help with
}
nextLevel.title = valueString;
nextLevel.itemname = valueString;
nextLevel.itemWord = selectedTitle;
function SimpleSymbols(str) {
var letter =['a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
var newstr = "";
for (var i = 0; i<str.length; i++){
if (str.charAt(i).toLowerCase() in letter){
newstr += "M";
}
else{
newstr += "X";
}
}
return newstr;
}
If str is "Argument goes here" it returns XXXXXXXXX. WHy doesn't it return MMMMMMMMMM?
I stored some html contents in a local resource file.
So it has html tags in it such as p, br, div, etc.
I used GetLocalResourceObject("myContent")
to display the content on the page,
but the page doesnt render it as HTML.