You need to sign in to do that
Don't have an account?
Aruna Vasahan
Jquery append in lightning components
Hi guys,
In my lightning controller I have a jquery code like this.
Type : Something
For this in Jquery there are methods like append, after, prepend. But when I tried to use them I'm not able to get the desired output. Does anyone know about this?
Thanks
Aruna
In my lightning controller I have a jquery code like this.
var Obj = JSON.parse(response.getReturnValue()); $("#type").html("Type :"); $("#demo").html(Obj.Type);For this I'm receiving in 2lines.But I need my output to be displayed in a single line, like
Type : Something
For this in Jquery there are methods like append, after, prepend. But when I tried to use them I'm not able to get the desired output. Does anyone know about this?
Thanks
Aruna
Got the solution for you.
You the above code.
If it not,please let me know.
Its working fine for me :) . Please mark it as best answer if it works.
Regards
Roshni
All Answers
Please try the below. If its not working, let me know.
Regards
Roshni
I haven't received the expected output.
This is what I received as output -->Type :[object Object]
Thanks
Aruna
OR can you post your code so we can find the issue.
I debugged my code but I was not able to find the mistake So I have uploaded my code below.Please look after it.
Thanks
Aruna
Got the solution for you.
You the above code.
If it not,please let me know.
Its working fine for me :) . Please mark it as best answer if it works.
Regards
Roshni
I am receiving output as Type :undefined
I don't know what's wrong here.
Thanks
Aruna
Just check whether there is any error while passing ID.
I have given my code & screenshot below.
Thanks
Aruna
The problem is that for the record you have entered, you havent selected the type for that record. It is empty.
If you select the type, Then it will show. Just try it..
Yes the account which I took to test my code was not entered with account type. Now I got the desired output. Thanks :D
Regards
Aruna